The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 25, 10:00 UTC
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>
Julius Marminge committed
Mar 4, 2026 at 10:20 UTC
b175d6b2a35f8b6869f981b96ceb20b2db979095
2 files changed
+7
-3
.github/workflows/release.yml
+3
-1
@@ -279,6 +279,8 @@ jobs:
279
steps:
280
- name: Checkout
281
uses: actions/checkout@v4
282
+ with:
283
+ ref: ${{ needs.preflight.outputs.ref }}
284
285
- name: Setup Bun
286
uses: oven-sh/setup-bun@v2
@@ -298,7 +300,7 @@ jobs:
300
run: bun run build --filter=@t3tools/web --filter=t3
301
302
- 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
304
305
release:
306
name: Publish GitHub Release
apps/server/scripts/cli.ts
+4
-2
@@ -2,7 +2,7 @@
2
3
import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
4
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";
6
import { Command, Flag } from "effect/unstable/cli";
7
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
8
@@ -77,6 +77,7 @@ const publishCmd = Command.make(
77
{
78
tag: Flag.string("tag").pipe(Flag.withDefault("latest")),
79
access: Flag.string("access").pipe(Flag.withDefault("public")),
80
+ appVersion: Flag.string("app-version").pipe(Flag.optional),
81
provenance: Flag.boolean("provenance").pipe(Flag.withDefault(false)),
82
dryRun: Flag.boolean("dry-run").pipe(Flag.withDefault(false)),
83
verbose: Flag.boolean("verbose").pipe(Flag.withDefault(false)),
@@ -107,10 +108,11 @@ const publishCmd = Command.make(
108
yield* fs.writeFileString(backupPath, original);
109
110
// Build package.json for publish
111
+ const version = Option.getOrElse(config.appVersion, () => serverPackageJson.version);
112
const pkg = {
113
name: serverPackageJson.name,
114
type: serverPackageJson.type,
113
- version: serverPackageJson.version,
115
+ version,
116
engines: serverPackageJson.engines,
117
files: serverPackageJson.files,
118
dependencies: serverPackageJson.dependencies as Record<string, unknown>,