Skip to content

v0.4.2

v0.4.2 #6

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
publish:
if: startsWith(github.event.release.tag_name, 'v')
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Ensure tag matches package version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
PKG_VERSION=$(node -p "require('./package.json').version")
TAG=${RELEASE_TAG#v}
if [ "$PKG_VERSION" != "$TAG" ]; then
echo "Package version $PKG_VERSION does not match tag v$TAG"
exit 1
fi
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --provenance --access public