Skip to content

0.2.1

0.2.1 #9

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
jobs:
release:
name: Verify · Publish · Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: package-lock.json
registry-url: "https://registry.npmjs.org"
- run: npm ci
- name: Verify version matches tag
run: |
TAG="${GITHUB_REF_NAME#v}"
PKG=$(node -p "require('./package.json').version")
if [ "$TAG" != "$PKG" ]; then
echo "::error::Version mismatch: package.json=$PKG tag=$TAG"
exit 1
fi
echo "Version verified: $PKG"
- name: Lint & typecheck
run: npm run check
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: Verify package contents
run: npm pack --dry-run
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true