Skip to content

Commit b175d6b

Browse files
Fix CLI publish using stale package.json version
The publish_cli job was checking out the default ref instead of the preflight commit, so it published with the pre-bump version. Add the correct ref to checkout and a --app-version flag as a safety override. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c5c12aa commit b175d6b

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ jobs:
279279
steps:
280280
- name: Checkout
281281
uses: actions/checkout@v4
282+
with:
283+
ref: ${{ needs.preflight.outputs.ref }}
282284

283285
- name: Setup Bun
284286
uses: oven-sh/setup-bun@v2
@@ -298,7 +300,7 @@ jobs:
298300
run: bun run build --filter=@t3tools/web --filter=t3
299301

300302
- name: Publish CLI package
301-
run: node apps/server/scripts/cli.ts publish --tag alpha --verbose
303+
run: node apps/server/scripts/cli.ts publish --tag alpha --app-version "${{ needs.preflight.outputs.version }}" --verbose
302304

303305
release:
304306
name: Publish GitHub Release

apps/server/scripts/cli.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
44
import * as NodeServices from "@effect/platform-node/NodeServices";
5-
import { Data, Effect, FileSystem, Logger, Path } from "effect";
5+
import { Data, Effect, FileSystem, Logger, Option, Path } from "effect";
66
import { Command, Flag } from "effect/unstable/cli";
77
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
88

@@ -77,6 +77,7 @@ const publishCmd = Command.make(
7777
{
7878
tag: Flag.string("tag").pipe(Flag.withDefault("latest")),
7979
access: Flag.string("access").pipe(Flag.withDefault("public")),
80+
appVersion: Flag.string("app-version").pipe(Flag.optional),
8081
provenance: Flag.boolean("provenance").pipe(Flag.withDefault(false)),
8182
dryRun: Flag.boolean("dry-run").pipe(Flag.withDefault(false)),
8283
verbose: Flag.boolean("verbose").pipe(Flag.withDefault(false)),
@@ -107,10 +108,11 @@ const publishCmd = Command.make(
107108
yield* fs.writeFileString(backupPath, original);
108109

109110
// Build package.json for publish
111+
const version = Option.getOrElse(config.appVersion, () => serverPackageJson.version);
110112
const pkg = {
111113
name: serverPackageJson.name,
112114
type: serverPackageJson.type,
113-
version: serverPackageJson.version,
115+
version,
114116
engines: serverPackageJson.engines,
115117
files: serverPackageJson.files,
116118
dependencies: serverPackageJson.dependencies as Record<string, unknown>,

0 commit comments

Comments
 (0)