diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..1f310ba --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,40 @@ +name: Create Release + +on: + workflow_dispatch: + inputs: + version: + description: "Release version (e.g. v1.2.3)" + required: true + +permissions: + contents: write + +jobs: + create_release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Enforce user permissions + run: | + ALLOWED_USERS=("piratekev" "gsgalloway") + if [[ ! " ${ALLOWED_USERS[@]} " =~ " ${GITHUB_ACTOR} " ]]; then + echo "❌ User $GITHUB_ACTOR is not allowed to run this workflow." + exit 1 + fi + + - name: Create Git tag + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + git tag v${{ github.event.inputs.version }} + git push origin v${{ github.event.inputs.version }} + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.event.inputs.version }} + name: Release ${{ github.event.inputs.version }} + generate_release_notes: true \ No newline at end of file