Skip to content

Commit 74dd244

Browse files
kmelveclaude
andcommitted
ci: set up changesets for npm publishing
- Add changesets for version management - Update CI with concurrency and matrix testing (Node 20, 22) - Use npm trusted publishing (OIDC) instead of NPM_TOKEN - Add repository info to package.json for provenance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 622a3ca commit 74dd244

File tree

5 files changed

+1236
-33
lines changed

5 files changed

+1236
-33
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@ on:
66
pull_request:
77
branches: [main]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
10-
test:
14+
lint-and-test:
15+
name: Lint & Test (Node ${{ matrix.node }})
1116
runs-on: ubuntu-latest
12-
1317
strategy:
1418
matrix:
15-
node-version: [18, 20, 22]
16-
19+
node: ['20', '22']
1720
steps:
1821
- uses: actions/checkout@v4
1922

20-
- name: Use Node.js ${{ matrix.node-version }}
23+
- name: Setup Node.js
2124
uses: actions/setup-node@v4
2225
with:
23-
node-version: ${{ matrix.node-version }}
26+
node-version: ${{ matrix.node }}
2427
cache: 'npm'
2528

2629
- name: Install dependencies
@@ -29,8 +32,8 @@ jobs:
2932
- name: Type check
3033
run: npm run typecheck
3134

32-
- name: Run tests
33-
run: npm run test:run
34-
3535
- name: Build
3636
run: npm run build
37+
38+
- name: Test
39+
run: npm run test:run

.github/workflows/release.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,50 @@ name: Release
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: release-${{ github.ref }}
10+
cancel-in-progress: false
711

812
jobs:
913
release:
14+
name: Release
1015
runs-on: ubuntu-latest
11-
1216
permissions:
13-
contents: read
17+
contents: write
18+
pull-requests: write
1419
id-token: write
15-
1620
steps:
1721
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
1824

19-
- name: Use Node.js 20
25+
- name: Setup Node.js
2026
uses: actions/setup-node@v4
2127
with:
22-
node-version: 20
28+
node-version: '22'
2329
cache: 'npm'
2430
registry-url: 'https://registry.npmjs.org'
2531

2632
- name: Install dependencies
2733
run: npm ci
2834

29-
- name: Type check
30-
run: npm run typecheck
31-
32-
- name: Run tests
33-
run: npm run test:run
34-
3535
- name: Build
3636
run: npm run build
3737

38-
- name: Publish to npm
39-
run: npm publish --provenance --access public
38+
- name: Test
39+
run: npm run test:run
40+
41+
- name: Create Release Pull Request or Publish
42+
id: changesets
43+
uses: changesets/action@v1
44+
with:
45+
publish: npx changeset publish
46+
version: npx changeset version
47+
title: 'chore: version packages'
48+
commit: 'chore: version packages'
4049
env:
41-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
NPM_CONFIG_PROVENANCE: true

0 commit comments

Comments
 (0)