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
|
||||||
+2
-1
@@ -46,5 +46,6 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/ArsenijSerjogin/tailwind-dashed-border/issues"
|
"url": "https://github.com/ArsenijSerjogin/tailwind-dashed-border/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/ArsenijSerjogin/tailwind-dashed-border"
|
"homepage": "https://github.com/ArsenijSerjogin/tailwind-dashed-border",
|
||||||
|
"packageManager": "pnpm@11.3.0+sha512.2c403d6594527287672b1f7056343a1f7c3634036a67ffabfcc2b3d7595d843768f8787148d1b57cf7956c90606bbd192857c363af19e96d2d0ec9ec5741d215"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user