Skip to content

Publish @dotmatrixlabs/create-dotx-plugin #3

Publish @dotmatrixlabs/create-dotx-plugin

Publish @dotmatrixlabs/create-dotx-plugin #3

Workflow file for this run

name: Publish @dotmatrixlabs/create-dotx-plugin
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Verify tag matches package version
if: github.ref_type == 'tag'
shell: bash
run: |
VERSION="$(node -p "require('./package.json').version")"
EXPECTED_TAG="v${VERSION}"
if [ "${GITHUB_REF_NAME}" != "${EXPECTED_TAG}" ]; then
echo "Expected tag ${EXPECTED_TAG}, got ${GITHUB_REF_NAME}"
exit 1
fi
- name: Verify package contents
run: npm pack --dry-run
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public --provenance