Problem: no way to publish the package
Publish to NPM / publish (push) Has been cancelled

Solution:
- Add workflow to do the job by pushing a version tag.
- pin the pnpm version via package.json
- Now, but likely temporary it is using token... but only as I can't login from PC and package never had published yet!
This commit is contained in:
2026-09-09 18:43:09 +03:00
parent 8ab701ec5a
commit 47745803c9
2 changed files with 40 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
name: Publish to NPM
on:
push:
tags:
- 'v*'
jobs:
publish:
if: github.repository == 'ArsenijSerjogin/tailwind-dashed-border'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.14.0'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- name: Verify version matches tag
run: |
VERSION="${GITHUB_REF_NAME#v}"
FILE_VERSION=$(node -p "require('./package.json').version")
if [ "$VERSION" != "$FILE_VERSION" ]; then
echo "Version mismatch: tag=$VERSION, package.json=$FILE_VERSION"
exit 1
fi
- run: pnpm install --frozen-lockfile
- run: pnpm run check
- run: pnpm run build
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --access public --provenance