Skip to content

Initial release

Initial release #9

Workflow file for this run

name: Publish to NPM
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.org
cache: yarn
- run: yarn install --immutable
- run: yarn build
- run: |
actual_version="$(jq -r '.version' package.json)"
if [ "$actual_version" != "${GITHUB_REF#refs/tags/v}" ]; then
echo "Expected package.json to have version ${GITHUB_REF#refs/tags/v}, got $actual_version"
exit 1
fi
- run: |
echo "npmAuthToken: $NODE_AUTH_TOKEN" >> ./.yarnrc.yml
yarn npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}