bump_version.yml

 1# Generated from xtask::workflows::extensions::bump_version within the Zed repository.
 2# Rebuild with `cargo xtask workflows`.
 3name: extensions::bump_version
 4on:
 5  pull_request:
 6    types:
 7    - labeled
 8  push:
 9    branches:
10    - main
11    paths-ignore:
12    - .github/**
13  workflow_dispatch: {}
14jobs:
15  determine_bump_type:
16    runs-on: namespace-profile-16x32-ubuntu-2204
17    permissions: {}
18    steps:
19    - id: get-bump-type
20      name: extensions::bump_version::get_bump_type
21      run: |
22        if [ "$HAS_MAJOR_LABEL" = "true" ]; then
23            bump_type="major"
24        elif [ "$HAS_MINOR_LABEL" = "true" ]; then
25            bump_type="minor"
26        else
27            bump_type="patch"
28        fi
29        echo "bump_type=$bump_type" >> $GITHUB_OUTPUT
30      shell: bash -euxo pipefail {0}
31      env:
32        HAS_MAJOR_LABEL: |-
33          ${{ (github.event.action == 'labeled' && github.event.label.name == 'major') ||
34          (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'major')) }}
35        HAS_MINOR_LABEL: |-
36          ${{ (github.event.action == 'labeled' && github.event.label.name == 'minor') ||
37          (github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'minor')) }}
38    outputs:
39      bump_type: ${{ steps.get-bump-type.outputs.bump_type }}
40  call_bump_version:
41    needs:
42    - determine_bump_type
43    if: github.event.action != 'labeled' || needs.determine_bump_type.outputs.bump_type != 'patch'
44    permissions:
45      contents: write
46      issues: write
47      pull-requests: write
48    uses: zed-industries/zed/.github/workflows/extension_bump.yml@main
49    secrets:
50      app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
51      app-secret: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
52    with:
53      bump-type: ${{ needs.determine_bump_type.outputs.bump_type }}
54      force-bump: true
55concurrency:
56  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}labels
57  cancel-in-progress: true