Skip to content
Open
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
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
tags:
- 'v[0-9]*.[0-9]*.[0-9]*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: '24'
package-manager-cache: false
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
version: 10
run_install: false
- run: pnpm install --ignore-scripts
- run: pnpm run build
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
retention-days: 1

publish:
needs: build
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
id-token: write # Required for npm OIDC Trusted Publishing
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- run: npm publish --provenance --access public
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
run: |
PRERELEASE=""
if [[ "$TAG_NAME" == *"beta"* ]] || [[ "$TAG_NAME" == *"alpha"* ]]; then
PRERELEASE="--prerelease"
fi
gh release create "$TAG_NAME" --generate-notes $PRERELEASE