Skip to content

Commit f4e4cc9

Browse files
pyyushclaude
andcommitted
ci: add CI and release workflows
CI: runs on push/PR to main, tests on Node 20 + 22 (build, typecheck, test). Release: triggered by v* tags, runs full test suite then publishes to npm and creates a GitHub Release with auto-generated notes. Requires NPM_TOKEN secret for npm publish. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4bbc20d commit f4e4cc9

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [20, 22]
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: npm
22+
23+
- run: npm ci
24+
- run: npm run build
25+
- run: npm run typecheck
26+
- run: npm test

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
registry-url: https://registry.npmjs.org
21+
cache: npm
22+
23+
- run: npm ci
24+
- run: npm run build
25+
- run: npm run typecheck
26+
- run: npm test
27+
- run: npm publish
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
31+
- name: Create GitHub Release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
generate_release_notes: true

0 commit comments

Comments
 (0)