Skip to content

Commit c453ddc

Browse files
committed
Add workflow to finalize release on merge or release PR
1 parent 1d7bfef commit c453ddc

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Finalize Release
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
branches:
7+
- "rc/**"
8+
9+
jobs:
10+
finalize-release:
11+
if: github.event.pull_request.merged == true
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.event.pull_request.merge_commit_sha }}
18+
19+
- name: Create release tag
20+
env:
21+
BASE_REF: ${{ github.event.pull_request.base.ref }}
22+
run: |
23+
version=${BASE_REF#rc/}
24+
echo "Creating release tag v$version"
25+
26+
git tag -a v$version -m "Release v$version"
27+
git push origin v$version
28+
29+
- name: Finalize release
30+
env:
31+
BASE_REF: ${{ github.event.pull_request.base.ref }}
32+
GITHUB_TOKEN: ${{ github.token }}
33+
run: |
34+
version=${BASE_REF#rc/}
35+
echo "Finalizing release v$version"
36+
37+
gh release edit v$version \
38+
--draft false \
39+
--prerelease false \
40+
--latest \
41+
--tag v$version

0 commit comments

Comments
 (0)