Skip to content

Commit 9fce269

Browse files
committed
Fix publish workflow to match docxodus (update npm, no --provenance, tag trigger)
1 parent e8c2642 commit 9fce269

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Publish to npm
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
tags:
6+
- 'v*'
67

78
jobs:
89
publish:
@@ -13,7 +14,6 @@ jobs:
1314
permissions:
1415
contents: read
1516
id-token: write
16-
attestations: write
1717

1818
steps:
1919
- name: Checkout
@@ -26,11 +26,14 @@ jobs:
2626
cache: 'npm'
2727
registry-url: 'https://registry.npmjs.org'
2828

29+
- name: Update npm to latest (required for trusted publishers)
30+
run: npm install -g npm@latest
31+
2932
- name: Extract version from tag
3033
id: version
3134
run: |
3235
# Remove 'v' prefix if present (e.g., v1.0.0 -> 1.0.0)
33-
VERSION=${GITHUB_REF_NAME#v}
36+
VERSION=${GITHUB_REF#refs/tags/v}
3437
echo "version=$VERSION" >> $GITHUB_OUTPUT
3538
echo "Publishing version: $VERSION"
3639
@@ -49,5 +52,5 @@ jobs:
4952
- name: Build library
5053
run: npm run build:lib
5154

52-
- name: Publish to npm (trusted publishing)
53-
run: npm publish --provenance --access public
55+
- name: Publish to npm
56+
run: npm publish --access public

0 commit comments

Comments
 (0)