Skip to content

Reference implmentation (#20) #4

Reference implmentation (#20)

Reference implmentation (#20) #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-*'
permissions:
contents: write
id-token: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
always-auth: true
- name: Install dependencies
run: npm ci
- name: Run all checks and build
run: npm run all
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Determine npm tag and release type
id: release-info
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" =~ -.*$ ]]; then
echo "npm_tag=next" >> $GITHUB_OUTPUT
echo "is_prerelease=true" >> $GITHUB_OUTPUT
else
echo "npm_tag=latest" >> $GITHUB_OUTPUT
echo "is_prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Publish to npm
run: npm publish --provenance --access public --tag ${{ steps.release-info.outputs.npm_tag }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
prerelease: ${{ steps.release-info.outputs.is_prerelease == 'true' }}