Skip to content

Commit 4d5aad3

Browse files
marcstraubeclaude
andauthored
chore(ci): add manual publish workflow for failed releases (#36)
## Summary - Adds `workflow_dispatch` triggered workflow to manually publish a tagged release to npm - Includes provenance, SBOM generation, and SBOM upload to GitHub Release - Safety net for when release-please publish fails (e.g. expired tokens, OIDC misconfiguration) ## Test plan - [ ] CI passes - [ ] After merge: trigger with `gh workflow run publish.yml -f tag=v1.0.3` to publish 1.0.3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8afe465 commit 4d5aad3

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish to npm
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Release tag to publish (e.g. v1.0.3)'
8+
required: true
9+
10+
permissions:
11+
contents: write
12+
id-token: write
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v6
21+
with:
22+
ref: ${{ inputs.tag }}
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v5
26+
with:
27+
version: 10
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v6
31+
with:
32+
node-version: '20'
33+
cache: 'pnpm'
34+
registry-url: 'https://registry.npmjs.org'
35+
36+
- name: Install dependencies
37+
run: pnpm install --frozen-lockfile
38+
39+
- name: Build package
40+
run: pnpm run build
41+
42+
- name: Publish to npm
43+
run: pnpm publish --access public --no-git-checks --provenance
44+
45+
- name: Generate SBOM
46+
run: pnpm run sbom
47+
48+
- name: Upload SBOM to release
49+
run: gh release upload ${{ inputs.tag }} sbom.cdx.json --clobber
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)