Skip to content

Commit d4cf9c0

Browse files
GHA-211 Add release workflow to update version branch on publish (#114)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 79c8f47 commit d4cf9c0

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
update-version-branch:
9+
name: Update version branch
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
# Pass token so that git push is authenticated without needing to rewrite the remote URL manually
18+
token: ${{ github.token }}
19+
20+
- name: Update version branch
21+
shell: bash
22+
env:
23+
RELEASE_TAG: ${{ github.ref_name }}
24+
run: |
25+
set -euo pipefail
26+
MAJOR=$(echo "$RELEASE_TAG" | cut -d. -f1)
27+
VERSION_BRANCH="v${MAJOR}"
28+
29+
git fetch --all --tags
30+
git checkout "$VERSION_BRANCH"
31+
git reset --hard "$RELEASE_TAG"
32+
git push origin "$VERSION_BRANCH" --force-with-lease

0 commit comments

Comments
 (0)