mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-04 04:03:21 +01:00
ci: Add workflow for bumping Zed versions (#54485)
Release Notes: - N/A
This commit is contained in:
1 parent
a658e1d3b0
commit
8d53ebc70e
20 files changed
+1141
-323
No files matched your search
@@ -10,7 +10,7 @@ on:
|
||||
type: string
|
||||
jobs:
|
||||
run_bump_patch_version:
|
||||
if: github.repository_owner == 'zed-industries'
|
||||
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
|
||||
runs-on: namespace-profile-16x32-ubuntu-2204
|
||||
steps:
|
||||
- id: generate-token
|
||||
@@ -25,8 +25,8 @@ jobs:
|
||||
clean: false
|
||||
ref: ${{ inputs.branch }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- id: bump-version
|
||||
name: bump_patch_version::run_bump_patch_version::bump_version
|
||||
- id: channel
|
||||
name: bump_patch_version::run_bump_patch_version::read_channel
|
||||
run: |
|
||||
channel="$(cat crates/zed/RELEASE_CHANNEL)"
|
||||
|
||||
@@ -38,30 +38,53 @@ jobs:
|
||||
tag_suffix="-pre"
|
||||
;;
|
||||
*)
|
||||
echo "this must be run on either of stable|preview release branches" >&2
|
||||
echo "::error::must be run on a stable or preview release branch"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
which cargo-set-version > /dev/null || cargo install cargo-edit -f --no-default-features --features "set-version"
|
||||
|
||||
version=$(script/get-crate-version zed)
|
||||
|
||||
{
|
||||
echo "channel=$channel"
|
||||
echo "version=$version"
|
||||
echo "tag_suffix=$tag_suffix"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
- name: bump_patch_version::run_bump_patch_version::verify_prior_release_exists
|
||||
run: |
|
||||
status=$(curl -s -o /dev/null -w '%{http_code}' "https://cloud.zed.dev/releases/$CHANNEL/$VERSION/asset?asset=zed&os=macos&arch=aarch64")
|
||||
if [[ "$status" != "200" ]]; then
|
||||
echo "::error::version $VERSION has not been released on $CHANNEL yet (HTTP $status) — bump the patch version only after the current version is released"
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
CHANNEL: ${{ steps.channel.outputs.channel }}
|
||||
VERSION: ${{ steps.channel.outputs.version }}
|
||||
- name: steps::install_cargo_edit
|
||||
uses: taiki-e/install-action@02cc5f8ca9f2301050c0c099055816a41ee05507
|
||||
with:
|
||||
tool: cargo-edit
|
||||
- id: bump-version
|
||||
name: bump_patch_version::run_bump_patch_version::bump_version
|
||||
run: |
|
||||
version="$(cargo set-version -p zed --bump patch 2>&1 | sed 's/.* //')"
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
echo "tag_suffix=$tag_suffix" >> "$GITHUB_OUTPUT"
|
||||
- id: commit
|
||||
name: bump_patch_version::run_bump_patch_version::commit_changes
|
||||
name: steps::bot_commit
|
||||
uses: IAreKyleW00t/verified-bot-commit@126a6a11889ab05bcff72ec2403c326cd249b84c
|
||||
with:
|
||||
message: Bump to ${{ steps.bump-version.outputs.version }} for @${{ github.actor }}
|
||||
ref: refs/heads/${{ inputs.branch }}
|
||||
files: '**'
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: bump_patch_version::run_bump_patch_version::create_version_tag
|
||||
- name: steps::create_tag
|
||||
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
|
||||
with:
|
||||
script: |
|
||||
github.rest.git.createRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: 'refs/tags/v${{ steps.bump-version.outputs.version }}${{ steps.bump-version.outputs.tag_suffix }}',
|
||||
ref: 'refs/tags/v${{ steps.bump-version.outputs.version }}${{ steps.channel.outputs.tag_suffix }}',
|
||||
sha: '${{ steps.commit.outputs.commit }}'
|
||||
})
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
|
||||
Reference in new issue
Block a user