Skip to content

v1.0.5

v1.0.5 #4

Workflow file for this run

name: Publish to npm
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment: production
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm test
- run: npm run lint && npm run format:check
- name: Check if package version matches release
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
GITHUB_REF_VERSION=${GITHUB_REF#refs/tags/v}
if [ "$PACKAGE_VERSION" != "$GITHUB_REF_VERSION" ]; then
echo "Package version ($PACKAGE_VERSION) does not match release tag ($GITHUB_REF_VERSION)"
exit 1
fi
- run: npm run build
- name: Publish to npm
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}