Skip to content

Commit 8889ea9

Browse files
authored
Merge pull request #2 from standard-crypto/gh-actions-create-release
add action to do releases
2 parents 6144960 + 500a0be commit 8889ea9

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Release version (e.g. v1.2.3)"
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
create_release:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Enforce user permissions
21+
run: |
22+
ALLOWED_USERS=("piratekev" "gsgalloway")
23+
if [[ ! " ${ALLOWED_USERS[@]} " =~ " ${GITHUB_ACTOR} " ]]; then
24+
echo "❌ User $GITHUB_ACTOR is not allowed to run this workflow."
25+
exit 1
26+
fi
27+
28+
- name: Create Git tag
29+
run: |
30+
git config user.name "${{ github.actor }}"
31+
git config user.email "${{ github.actor }}@users.noreply.github.com"
32+
git tag v${{ github.event.inputs.version }}
33+
git push origin v${{ github.event.inputs.version }}
34+
35+
- name: Create GitHub Release
36+
uses: softprops/action-gh-release@v1
37+
with:
38+
tag_name: ${{ github.event.inputs.version }}
39+
name: Release ${{ github.event.inputs.version }}
40+
generate_release_notes: true

0 commit comments

Comments
 (0)