Skip to content

Commit 8c2797a

Browse files
prep npm
1 parent 03534e8 commit 8c2797a

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
id-token: write
1011

1112
jobs:
1213
preflight:
@@ -158,9 +159,50 @@ jobs:
158159
path: release/*
159160
if-no-files-found: error
160161

162+
# publish_cli:
163+
# name: Publish CLI to npm
164+
# needs: [preflight, build]
165+
# runs-on: ubuntu-24.04
166+
# steps:
167+
# - name: Checkout
168+
# uses: actions/checkout@v4
169+
170+
# - name: Setup Bun
171+
# uses: oven-sh/setup-bun@v2
172+
# with:
173+
# bun-version-file: package.json
174+
175+
# - name: Setup Node
176+
# uses: actions/setup-node@v4
177+
# with:
178+
# node-version-file: package.json
179+
# registry-url: https://registry.npmjs.org
180+
181+
# - name: Install dependencies
182+
# run: bun install --frozen-lockfile
183+
184+
# - name: Set CLI package version from release tag
185+
# env:
186+
# RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
187+
# run: |
188+
# node --input-type=module -e '
189+
# import { readFileSync, writeFileSync } from "node:fs";
190+
# const packagePath = "apps/server/package.json";
191+
# const packageJson = JSON.parse(readFileSync(packagePath, "utf8"));
192+
# packageJson.version = process.env.RELEASE_VERSION;
193+
# writeFileSync(packagePath, `${JSON.stringify(packageJson, null, 2)}\n`);
194+
# '
195+
196+
# - name: Build CLI package
197+
# run: bun run build --filter=@t3tools/web --filter=t3
198+
199+
# - name: Publish CLI package
200+
# run: bun --cwd apps/server publish --access public
201+
161202
release:
162203
name: Publish GitHub Release
163204
needs: [preflight, build]
205+
# needs: [preflight, build, publish_cli]
164206
runs-on: ubuntu-24.04
165207
steps:
166208
- name: Download all desktop artifacts

‎docs/release.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,28 @@ This document covers how to run desktop releases from one tag, first without sig
1212
- Linux `x64` AppImage
1313
- Windows `x64` NSIS installer
1414
- Publishes one GitHub Release with all produced files.
15+
- Publishes the CLI package (`apps/server`, npm package `t3`) with OIDC trusted publishing.
1516
- Signing is optional and auto-detected per platform from secrets.
1617

18+
## 0) npm OIDC trusted publishing setup (CLI)
19+
20+
The workflow publishes the CLI with `bun publish` from `apps/server` after bumping
21+
the package version to the release tag version.
22+
23+
Checklist:
24+
25+
1. Confirm npm org/user owns package `t3` (or rename package first if needed).
26+
2. In npm package settings, configure Trusted Publisher:
27+
- Provider: GitHub Actions
28+
- Repository: this repo
29+
- Workflow file: `.github/workflows/release.yml`
30+
- Environment (if used): match your npm trusted publishing config
31+
3. Ensure npm account and org policies allow trusted publishing for the package.
32+
4. Create release tag `vX.Y.Z` and push; workflow will:
33+
- set `apps/server/package.json` version to `X.Y.Z`
34+
- build web + server
35+
- run `bun publish --access public`
36+
1737
## 1) Dry-run release without signing
1838

1939
Use this first to validate the release pipeline.

0 commit comments

Comments
 (0)