Repository navigation
71 lines (66 loc) · 2.6 KB
/
Copy pathrelease-typescript.yml
File metadata and controls
71 lines (66 loc) · 2.6 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
68
69
70
71
name: Release TypeScript SDK
# Pending changesets on dev open (or update) the "chore: release TypeScript
# SDK" pull request into dev, which bumps versions and changelogs. Nothing is
# published from dev. Publishing happens when production is fast-forwarded to
# a dev commit whose SDK version is not on npm yet: changeset publish
# publishes it, pushes its tag, and creates its GitHub release.
on:
push:
branches: [dev, production]
paths:
- "sdk/**"
- ".github/workflows/release-typescript.yml"
workflow_dispatch:
# Finish an in-flight publish before another run checks registry availability.
concurrency:
group: release-typescript-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
id-token: write
pull-requests: write
jobs:
version:
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- run: bun install --frozen-lockfile
- uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2
with:
cwd: sdk
pr-title: "chore: release TypeScript SDK"
publish:
if: github.ref == 'refs/heads/production'
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: 24
registry-url: https://registry.npmjs.org
- run: npm install --global npm@latest
- run: bun install --frozen-lockfile
- run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- run: bun run release
- name: Push tags and create GitHub releases
env:
GH_TOKEN: ${{ github.token }}
run: |
for tag in $(git tag --points-at HEAD --list '@kitlangton/hex@*'); do
git push origin "refs/tags/$tag"
awk -v heading="## ${tag##*@}" '$0 == heading { on = 1; next } /^## / && on { exit } on' \
typescript/CHANGELOG.md > "$RUNNER_TEMP/notes.md"
# The app's stable release is Latest; an SDK release never takes it.
gh release create "$tag" --verify-tag --title "$tag" --notes-file "$RUNNER_TEMP/notes.md" --latest=false
done