Skip to content

Commit 8665d75

Browse files
elucidsoftclaude
andcommitted
fix: match warpkit publish pattern — tag trigger, no provenance flag
- Trigger on tag push (v*) instead of release event - Run CI as reusable workflow before publish - Drop --provenance flag (causes 404 on trusted publisher) - Set version from git tag - Use Node 24 for publish Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent df03592 commit 8665d75

2 files changed

Lines changed: 26 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
workflow_call:
89

910
jobs:
1011
test:

.github/workflows/publish.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,47 @@
11
name: Publish to npm
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
id-token: write
611

712
jobs:
13+
ci:
14+
uses: ./.github/workflows/ci.yml
15+
816
publish:
17+
needs: ci
918
runs-on: ubuntu-latest
10-
11-
permissions:
12-
contents: read
13-
id-token: write
14-
1519
steps:
1620
- uses: actions/checkout@v4
1721

1822
- name: Setup Node.js
1923
uses: actions/setup-node@v4
2024
with:
21-
node-version: 20
22-
registry-url: https://registry.npmjs.org
25+
node-version: '24'
26+
registry-url: 'https://registry.npmjs.org'
2327
cache: npm
2428

2529
- name: Install dependencies
2630
run: npm ci
2731

32+
- name: Set version from tag
33+
run: |
34+
VERSION="${GITHUB_REF_NAME#v}"
35+
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
36+
node -e "
37+
const fs = require('fs');
38+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
39+
pkg.version = '$VERSION';
40+
fs.writeFileSync('package.json', JSON.stringify(pkg, null, '\t') + '\n');
41+
"
42+
2843
- name: Build
2944
run: npm run build
3045

3146
- name: Publish
32-
run: npm publish --provenance --access public
47+
run: npm publish --access public

0 commit comments

Comments
 (0)