Skip to content

Commit ac60f9f

Browse files
rsbhclaude
andcommitted
ci: add canary release workflow for PR builds
Publishes canary npm release on every PR commit with version format 0.1.0-canary.<short-sha> using --tag canary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 251f5d1 commit ac60f9f

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/canary.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: canary
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
canary-release:
9+
name: Publish canary to npm
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
defaults:
13+
run:
14+
working-directory: ./packages/chronicle
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Bun
20+
uses: oven-sh/setup-bun@v2
21+
22+
- name: Install dependencies
23+
run: bun install --frozen-lockfile
24+
working-directory: .
25+
26+
- name: Build CLI
27+
run: bun build-cli.ts
28+
29+
- name: Set canary version
30+
run: |
31+
SHORT_SHA=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c1-7)
32+
VERSION=$(jq -r .version package.json)-canary.${SHORT_SHA}
33+
jq --arg v "$VERSION" '.version = $v' package.json > package.tmp.json
34+
mv package.tmp.json package.json
35+
echo "Published version: $VERSION"
36+
37+
- name: Publish
38+
run: bun publish --tag canary --access public
39+
env:
40+
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)