2024-04-17 01:32:51 +00:00
|
|
|
name: bump_patch_version
|
2024-04-16 02:31:12 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
branch:
|
|
|
|
description: "Branch name to run on"
|
|
|
|
required: true
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
# Allow only one workflow per any non-`main` branch.
|
2024-04-30 02:55:50 +00:00
|
|
|
group: ${{ github.workflow }}-${{ inputs.branch }}
|
2024-04-16 02:31:12 +00:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
bump_patch_version:
|
|
|
|
runs-on:
|
2024-09-18 17:35:55 +00:00
|
|
|
- buildjet-16vcpu-ubuntu-2204
|
2024-04-16 02:31:12 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-10-09 22:24:10 +00:00
|
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
|
2024-04-16 02:31:12 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.inputs.branch }}
|
2024-04-17 01:32:51 +00:00
|
|
|
ssh-key: ${{ secrets.ZED_BOT_DEPLOY_KEY }}
|
2024-04-16 02:31:12 +00:00
|
|
|
|
|
|
|
- name: Bump Patch Version
|
|
|
|
run: |
|
2024-04-17 01:32:51 +00:00
|
|
|
set -eux
|
|
|
|
|
2024-04-16 02:31:12 +00:00
|
|
|
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
|
2024-09-27 19:42:04 +00:00
|
|
|
which cargo-set-version > /dev/null || cargo install cargo-edit
|
2024-04-16 02:31:12 +00:00
|
|
|
output=$(cargo set-version -p zed --bump patch 2>&1 | sed 's/.* //')
|
2024-04-17 01:32:51 +00:00
|
|
|
git commit -am "Bump to $output for @$GITHUB_ACTOR" --author "Zed Bot <hi@zed.dev>"
|
|
|
|
git tag v${output}${tag_suffix}
|
|
|
|
git push origin HEAD v${output}${tag_suffix}
|