bump_patch_version.yml

 1# Generated from xtask::workflows::bump_patch_version
 2# Rebuild with `cargo xtask workflows`.
 3name: bump_patch_version
 4on:
 5  workflow_dispatch:
 6    inputs:
 7      branch:
 8        description: Branch name to run on
 9        required: true
10        type: string
11jobs:
12  run_bump_patch_version:
13    if: github.repository_owner == 'zed-industries'
14    runs-on: namespace-profile-16x32-ubuntu-2204
15    steps:
16    - id: generate-token
17      name: steps::authenticate_as_zippy
18      uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
19      with:
20        app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
21        private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
22    - name: steps::checkout_repo
23      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
24      with:
25        clean: false
26        ref: ${{ inputs.branch }}
27        token: ${{ steps.generate-token.outputs.token }}
28    - id: bump-version
29      name: bump_patch_version::run_bump_patch_version::bump_version
30      run: |
31        channel="$(cat crates/zed/RELEASE_CHANNEL)"
32
33        tag_suffix=""
34        case $channel in
35          stable)
36            ;;
37          preview)
38            tag_suffix="-pre"
39            ;;
40          *)
41            echo "this must be run on either of stable|preview release branches" >&2
42            exit 1
43            ;;
44        esac
45        which cargo-set-version > /dev/null || cargo install cargo-edit -f --no-default-features --features "set-version"
46        version="$(cargo set-version -p zed --bump patch 2>&1 | sed 's/.* //')"
47        echo "version=$version" >> "$GITHUB_OUTPUT"
48        echo "tag_suffix=$tag_suffix" >> "$GITHUB_OUTPUT"
49    - id: commit
50      name: bump_patch_version::run_bump_patch_version::commit_changes
51      uses: IAreKyleW00t/verified-bot-commit@126a6a11889ab05bcff72ec2403c326cd249b84c
52      with:
53        message: Bump to ${{ steps.bump-version.outputs.version }} for @${{ github.actor }}
54        ref: refs/heads/${{ inputs.branch }}
55        files: '**'
56        token: ${{ steps.generate-token.outputs.token }}
57    - name: bump_patch_version::run_bump_patch_version::create_version_tag
58      uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
59      with:
60        script: |
61          github.rest.git.createRef({
62              owner: context.repo.owner,
63              repo: context.repo.repo,
64              ref: 'refs/tags/v${{ steps.bump-version.outputs.version }}${{ steps.bump-version.outputs.tag_suffix }}',
65              sha: '${{ steps.commit.outputs.commit }}'
66          })
67        github-token: ${{ steps.generate-token.outputs.token }}
68concurrency:
69  group: ${{ github.workflow }}-${{ inputs.branch }}
70  cancel-in-progress: true
71defaults:
72  run:
73    shell: bash -euxo pipefail {0}