Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,28 @@ jobs:
run: npm publish --access public --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

release:
name: create GitHub release
needs: publish
timeout-minutes: 5
runs-on: ubuntu-latest
permissions:
contents: write
env:
RELEASE_TAG: ${{ github.ref_name }}
GH_TOKEN: ${{ github.token }}
steps:
# Runs only after npm publish succeeds; an existing release is left as is,
# so re-running a publish never fails here.
- name: Create GitHub release
shell: bash
run: |
set -euo pipefail

if gh release view "${RELEASE_TAG}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
echo "Release ${RELEASE_TAG} already exists."
exit 0
fi

gh release create "${RELEASE_TAG}" --repo "${GITHUB_REPOSITORY}" --verify-tag --generate-notes --title "${RELEASE_TAG}"
Loading