-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (50 loc) · 1.67 KB
/
release.yml
File metadata and controls
57 lines (50 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
skip_publish:
description: 'Skip npm publish (for testing)'
type: boolean
default: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build
- name: Verify dist outputs
run: |
test -f packages/sdk/dist/index.js
test -f packages/sdk/dist/index.d.ts
test -f packages/agents/dist/index.js
test -f packages/agents/dist/index.d.ts
test -f packages/rig/dist/index.js
test -f packages/rig/dist/index.d.ts
- name: Typecheck
run: npx tsc -b packages/sdk packages/agents packages/rig
- name: Publish packages
if: success() && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.skip_publish))
run: |
for pkg in packages/sdk packages/agents packages/rig; do
name=$(node -p "require('./$pkg/package.json').name")
version=$(node -p "require('./$pkg/package.json').version")
if npm view "$name@$version" version >/dev/null 2>&1; then
echo "⏭ $name@$version already published, skipping"
else
echo "Publishing $name@$version..."
npm publish --workspace "$pkg" --access public --provenance
fi
done
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}