From bd79edee717f51b5c8a843d93132090caa804a45 Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Mon, 1 Dec 2025 23:58:15 +0100 Subject: [PATCH] extension_ci: Improve behavior when no Rust is present (#43953) Release Notes: - N/A --- .github/workflows/extension_bump.yml | 20 ++++++------ .../src/tasks/workflows/extension_bump.rs | 32 ++++++++----------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.github/workflows/extension_bump.yml b/.github/workflows/extension_bump.yml index 7fce9decb2f429e39cdae4dd26ae7f621e72e56b..0ea88b6805a3e8609d99e18ab13bcf872e24d108 100644 --- a/.github/workflows/extension_bump.yml +++ b/.github/workflows/extension_bump.yml @@ -114,21 +114,21 @@ jobs: run: | OLD_VERSION="${{ needs.check_bump_needed.outputs.current_version }}" - cat < .bumpversion.cfg - [bumpversion] - current_version = "$OLD_VERSION" + if [[ -f "extension.toml" ]]; then + EXTENSION_TOML="extension.toml" + fi - [bumpversion:file:Cargo.toml] + if [[ -f "Cargo.toml" ]]; then + CARGO_TOML="Cargo.toml" + fi - [bumpversion:file:extension.toml] + bump2version --verbose --current-version "$OLD_VERSION" --no-configured-files ${{ inputs.bump-type }} "$EXTENSION_TOML" "$CARGO_TOML" - EOF + if [[ -f "Cargo.toml" ]]; then + cargo update --workspace + fi - bump2version --verbose ${{ inputs.bump-type }} NEW_VERSION="$(sed -n 's/version = \"\(.*\)\"/\1/p' < extension.toml)" - cargo update --workspace - - rm .bumpversion.cfg echo "new_version=${NEW_VERSION}" >> "$GITHUB_OUTPUT" shell: bash -euxo pipefail {0} diff --git a/tooling/xtask/src/tasks/workflows/extension_bump.rs b/tooling/xtask/src/tasks/workflows/extension_bump.rs index c3feb7973b2dc95916e46d77b369cb6d6a6f3645..c177f98f2784b149932251bb248eac7b0925f3d3 100644 --- a/tooling/xtask/src/tasks/workflows/extension_bump.rs +++ b/tooling/xtask/src/tasks/workflows/extension_bump.rs @@ -13,16 +13,6 @@ use crate::tasks::workflows::{ }, }; -const BUMPVERSION_CONFIG: &str = indoc! {r#" - [bumpversion] - current_version = "$OLD_VERSION" - - [bumpversion:file:Cargo.toml] - - [bumpversion:file:extension.toml] - "# -}; - const VERSION_CHECK: &str = r#"sed -n 's/version = \"\(.*\)\"/\1/p' < extension.toml"#; // This is used by various extensions repos in the zed-extensions org to bump extension versions. @@ -252,20 +242,26 @@ fn bump_version(current_version: &JobOutput, bump_type: &WorkflowInput) -> (Step indoc! {r#" OLD_VERSION="{}" - cat < .bumpversion.cfg - {} - EOF + if [[ -f "extension.toml" ]]; then + EXTENSION_TOML="extension.toml" + fi - bump2version --verbose {} - NEW_VERSION="$({})" - cargo update --workspace + if [[ -f "Cargo.toml" ]]; then + CARGO_TOML="Cargo.toml" + fi + + bump2version --verbose --current-version "$OLD_VERSION" --no-configured-files {} "$EXTENSION_TOML" "$CARGO_TOML" - rm .bumpversion.cfg + if [[ -f "Cargo.toml" ]]; then + cargo update --workspace + fi + + NEW_VERSION="$({})" echo "new_version=${{NEW_VERSION}}" >> "$GITHUB_OUTPUT" "# }, - current_version, BUMPVERSION_CONFIG, bump_type, VERSION_CHECK + current_version, bump_type, VERSION_CHECK )) .id("bump-version");