extension_ci: Improve behavior when no Rust is present (#43953)

Release Notes:

- N/A
This commit is contained in:
Finn Evers
2025-12-01 23:58:15 +01:00
committed by GitHub
parent 0bb1c6ad3e
commit bd79edee71
2 changed files with 24 additions and 28 deletions

View File

@@ -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 <<EOF > .bumpversion.cfg
{}
EOF
if [[ -f "extension.toml" ]]; then
EXTENSION_TOML="extension.toml"
fi
if [[ -f "Cargo.toml" ]]; then
CARGO_TOML="Cargo.toml"
fi
bump2version --verbose --current-version "$OLD_VERSION" --no-configured-files {} "$EXTENSION_TOML" "$CARGO_TOML"
if [[ -f "Cargo.toml" ]]; then
cargo update --workspace
fi
bump2version --verbose {}
NEW_VERSION="$({})"
cargo update --workspace
rm .bumpversion.cfg
echo "new_version=${{NEW_VERSION}}" >> "$GITHUB_OUTPUT"
"#
},
current_version, BUMPVERSION_CONFIG, bump_type, VERSION_CHECK
current_version, bump_type, VERSION_CHECK
))
.id("bump-version");