mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
extension_ci: Improve behavior when no Rust is present (#43953)
Release Notes: - N/A
This commit is contained in:
parent
0bb1c6ad3e
commit
bd79edee71
2 changed files with 24 additions and 28 deletions
20
.github/workflows/extension_bump.yml
vendored
20
.github/workflows/extension_bump.yml
vendored
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue