Skip to content

Commit d13a0d8

Browse files
marcstraubeclaude
andauthored
chore(ci): consolidate publish into release-please workflow (#37)
## Summary - Add `workflow_dispatch` trigger to `release-please.yml` for manual re-publishes - Remove separate `publish.yml` (npm only allows one trusted publisher per package) - Manual trigger: `gh workflow run release-please.yml -f tag=v1.0.3` ## Test plan - [ ] CI passes - [ ] After merge: trigger manual publish for v1.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 4d5aad3 commit d13a0d8

2 files changed

Lines changed: 44 additions & 51 deletions

File tree

.github/workflows/publish.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/release-please.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
branches:
66
- master
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Publish an existing release tag (e.g. v1.0.3)'
11+
required: true
712

813
permissions:
914
contents: write
@@ -12,6 +17,7 @@ permissions:
1217

1318
jobs:
1419
release-please:
20+
if: github.event_name == 'push'
1521
runs-on: ubuntu-latest
1622
steps:
1723
- uses: googleapis/release-please-action@v4
@@ -59,3 +65,41 @@ jobs:
5965
env:
6066
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6167
run: gh release upload ${{ steps.release.outputs.tag_name }} sbom.cdx.json --clobber
68+
69+
publish:
70+
if: github.event_name == 'workflow_dispatch'
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v6
75+
with:
76+
ref: ${{ inputs.tag }}
77+
78+
- name: Setup pnpm
79+
uses: pnpm/action-setup@v5
80+
with:
81+
version: 10
82+
83+
- name: Setup Node.js
84+
uses: actions/setup-node@v6
85+
with:
86+
node-version: '20'
87+
cache: 'pnpm'
88+
registry-url: 'https://registry.npmjs.org'
89+
90+
- name: Install dependencies
91+
run: pnpm install --frozen-lockfile
92+
93+
- name: Build package
94+
run: pnpm run build
95+
96+
- name: Publish to npm
97+
run: pnpm publish --access public --no-git-checks --provenance
98+
99+
- name: Generate SBOM
100+
run: pnpm run sbom
101+
102+
- name: Upload SBOM to release
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
run: gh release upload ${{ inputs.tag }} sbom.cdx.json --clobber

0 commit comments

Comments
 (0)