-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 2.34 KB
/
release.yml
File metadata and controls
70 lines (59 loc) · 2.34 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
name: Release
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
environment: npm
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
# npm >= 11.5.1 required for Trusted Publishing (OIDC).
# Node 22 ships npm 10.x, so use npm 11 explicitly instead of floating to a future major.
- name: Upgrade npm for Trusted Publishing
run: npm install -g npm@11
- name: Verify toolchain
run: |
echo "node $(node --version)"
echo "npm $(npm --version)"
echo "bun $(bun --version)"
- run: bun install
- run: bunx turbo build --filter='./packages/*'
- run: bunx turbo test --filter='./packages/*'
- name: Create Release PR or Publish
uses: changesets/action@v1
with:
publish: npx changeset publish
version: bunx changeset version
commit: 'chore: version packages'
title: 'chore: version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# No NPM_TOKEN needed — npm Trusted Publishing (OIDC) handles auth.
# changesets/action detects id-token and skips .npmrc generation.
# ── Canary publish ───────────────────────────────────────────
# V1 canary releases use the local release scripts documented in
# docs/guides/release-channels.md. Do not pass --tag to changeset
# publish while in pre mode; Changesets uses the pre-mode tag.
# CI canary publishing should be tested separately before making it
# the primary operator path.
#
# ── Stable publish ────────────────────────────────────────────
# To publish stable:
# 1. Ensure not in pre mode (bunx changeset pre exit)
# 2. Add changeset (bunx changeset)
# 3. Push to main → workflow creates a "Version Packages" PR
# 4. Merge the PR → workflow publishes to npm @latest