Skip to content

Initial release of new plugin v1.0.0 (#1) #1

Initial release of new plugin v1.0.0 (#1)

Initial release of new plugin v1.0.0 (#1) #1

Workflow file for this run

name: Publish to NPM
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Verify tag matches package.json version
env:
REF_NAME: ${{ github.ref_name }}
run: |
TAG_VERSION="${REF_NAME#v}"
PKG_VERSION="$(node -p "require('./package.json').version")"
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)."
exit 1
fi
- name: Install dependencies
run: npm ci
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}