Skip to content

Commit ead181f

Browse files
committed
ci: add a workflow to create a GitHub Release whenever a new tag is pushed
1 parent 2e0dc29 commit ead181f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: github/release
2+
run-name: "[${{ github.ref_name }}] github/release"
3+
4+
5+
on:
6+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
7+
push:
8+
tags:
9+
- '*'
10+
11+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#defining-access-for-the-github_token-scopes
12+
permissions: {}
13+
14+
15+
jobs:
16+
create-release:
17+
permissions:
18+
contents: write
19+
steps:
20+
- id: checkout_source
21+
name: Checkout Source
22+
# https://github.com/actions/checkout
23+
uses: actions/checkout@v5
24+
with:
25+
fetch-depth: 0
26+
27+
- id: create_release
28+
name: Create GitHub Release
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
shell: bash --noprofile --norc -euxo pipefail {0}
32+
run: |
33+
# create GitHub release
34+
# https://cli.github.com/manual/gh_release_create
35+
args=(
36+
'${{ github.ref_name }}'
37+
--repo '${{ github.repository }}'
38+
--title 'Release ${{ github.ref_name }}'
39+
--generate-notes
40+
)
41+
url=$(gh release create "${args[@]}")
42+
echo "::notice::${url}"

0 commit comments

Comments
 (0)