bump_patch_version #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: bump_patch_version | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "Branch name to run on" | |
required: true | |
concurrency: | |
# Allow only one workflow per any non-`main` branch. | |
group: ${{ github.workflow }}-${{ inputs.branch }} | |
cancel-in-progress: true | |
jobs: | |
bump_patch_version: | |
runs-on: | |
- buildjet-16vcpu-ubuntu-2204 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
ssh-key: ${{ secrets.ZED_BOT_DEPLOY_KEY }} | |
- name: Bump Patch Version | |
run: | | |
set -eux | |
channel=$(cat crates/zed/RELEASE_CHANNEL) | |
tag_suffix="" | |
case $channel in | |
stable) | |
;; | |
preview) | |
tag_suffix="-pre" | |
;; | |
*) | |
echo "this must be run on either of stable|preview release branches" >&2 | |
exit 1 | |
;; | |
esac | |
which cargo-set-version > /dev/null || cargo install cargo-edit | |
output=$(cargo set-version -p zed --bump patch 2>&1 | sed 's/.* //') | |
git commit -am "Bump to $output for @$GITHUB_ACTOR" --author "Zed Bot <[email protected]>" | |
git tag v${output}${tag_suffix} | |
git push origin HEAD v${output}${tag_suffix} |