Skip to content

Commit e2242e3

Browse files
gracefullightclaude
andcommitted
ci: add release-please workflow with npm publish on release
- release-please creates/updates release PR on pushes to main - npm publish triggers automatically when release PR merges - publishes with --provenance for supply chain security Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent face26a commit e2242e3

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Release Workflow — release-please PR → npm publish on merge
2+
#
3+
# 1. release-please creates/updates a release PR on every push to main
4+
# 2. When the release PR merges, it creates a GitHub Release
5+
# 3. The npm publish job triggers on the new release
6+
7+
name: Release
8+
9+
on:
10+
push:
11+
branches: [main]
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
jobs:
18+
release-please:
19+
name: Release Please
20+
runs-on: ubuntu-latest
21+
outputs:
22+
release_created: ${{ steps.release.outputs['apps/cli--release_created'] }}
23+
tag_name: ${{ steps.release.outputs['apps/cli--tag_name'] }}
24+
steps:
25+
- uses: googleapis/release-please-action@v4
26+
id: release
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
npm-publish:
31+
name: Publish to npm
32+
runs-on: ubuntu-latest
33+
needs: release-please
34+
if: needs.release-please.outputs.release_created == 'true'
35+
permissions:
36+
contents: read
37+
id-token: write
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: oven-sh/setup-bun@v2
41+
- run: bun install --frozen-lockfile
42+
- run: bun run build
43+
working-directory: apps/cli
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: 22
47+
registry-url: https://registry.npmjs.org
48+
- run: npm publish --provenance --access public
49+
working-directory: apps/cli
50+
env:
51+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"apps/cli": "0.1.0"
3+
}

release-please-config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
"apps/cli": {
5+
"package-name": "agent-valley",
6+
"release-type": "node",
7+
"changelog-path": "CHANGELOG.md",
8+
"bump-minor-pre-major": true,
9+
"bump-patch-for-minor-pre-major": true
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)