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:
@@ -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
|
||||
Reference in New Issue
Block a user