Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

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

Finn Eversbd79edee717f
diff --git a/.github/workflows/extension_bump.yml b/.github/workflows/extension_bump.yml
index 7fce9decb2f..0ea88b6805a 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 <<EOF > .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 c3feb7973b2..c177f98f278 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 <<EOF > .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");