-
Notifications
You must be signed in to change notification settings - Fork 21
67 lines (63 loc) · 2.11 KB
/
Copy pathrelease.yml
File metadata and controls
67 lines (63 loc) · 2.11 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
58
59
60
61
62
63
64
65
66
67
name: Release
on:
push:
branches: [main]
paths:
- 'packages/buzzkit/**'
- '.changeset/**'
- '.github/workflows/release.yml'
workflow_dispatch:
concurrency:
group: release
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- name: Build and test the SDK
run: |
bun run sdk:build
bun run --cwd packages/buzzkit test
- name: Prove the published package imports
run: |
cd packages/buzzkit
bun run scripts/publish-manifest.ts
bunx publint
bun pm pack --destination /tmp/pack
cd /tmp/pack
mkdir consumer && cd consumer
printf '{"name":"c","type":"module","private":true}' > package.json
npm install ../buzzkit-*.tgz
node --input-type=module -e "
import { BuzzKit, signIdentity } from 'buzzkit';
import { BuzzKitClient } from 'buzzkit/client';
import { verifyWebhook } from 'buzzkit/webhooks';
if (typeof BuzzKit !== 'function') throw new Error('the root entry did not load');
if (typeof BuzzKitClient !== 'function') throw new Error('the browser entry did not load');
if (typeof signIdentity !== 'function' || typeof verifyWebhook !== 'function') {
throw new Error('a server helper did not load');
}
"
cd "$GITHUB_WORKSPACE" && git checkout -- packages/buzzkit/package.json
- uses: changesets/action@v1
with:
version: bun run sdk:version
publish: bun run sdk:release
title: 'chore: release the SDK'
commit: 'chore: release the SDK'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}