Skip to content

Publish to npm

Publish to npm #5

Workflow file for this run

name: Publish to npm
on:
release:
types: [created]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- run: npm test
publish-npm:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org/
# Set version from the release tag (e.g. v1.0.0 → 1.0.0)
- run: npm version ${GITHUB_REF_NAME#v} --no-git-tag-version --allow-same-version
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}