Skip to content

Commit f7dba65

Browse files
ci: create github release and tag after publish
1 parent 70b4e7d commit f7dba65

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55

66
permissions:
7-
contents: read
7+
contents: write
88
id-token: write
99

1010
jobs:
@@ -91,3 +91,20 @@ jobs:
9191

9292
- name: Publish to JSR
9393
run: npx jsr publish
94+
95+
- name: Create GitHub Release
96+
env:
97+
GH_TOKEN: ${{ github.token }}
98+
VERSION: ${{ steps.version.outputs.value }}
99+
run: |
100+
set -euo pipefail
101+
TAG="v${VERSION}"
102+
if gh release view "${TAG}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
103+
echo "Release ${TAG} already exists."
104+
exit 1
105+
fi
106+
gh release create "${TAG}" \
107+
--repo "${GITHUB_REPOSITORY}" \
108+
--target "${GITHUB_SHA}" \
109+
--title "${TAG}" \
110+
--generate-notes

0 commit comments

Comments
 (0)