From a5bb1767d8948e083e66c68543a26530893db05c Mon Sep 17 00:00:00 2001 From: flint Date: Wed, 16 Sep 2026 23:22:26 -0700 Subject: [PATCH] fix(release): the binary copy was always a self-copy and failed the run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v0.6.0 release run failed all four Build Binaries jobs with: cp: 'packages/cli/dist/tps-linux-x64' and 'packages/cli/dist/tps-linux-x64' are the same file build-portable.ts writes dist/tps-, deriving the name by stripping the target's 'bun-' prefix. Every matrix row sets artifact to exactly that name, so SRC and DST are identical by construction for all four targets and the unconditional cp could never succeed. This would have broken every release since the output path settled. Nobody found it because nobody cut a release for seven months — the shipping gap hid its own cause, and the first attempt to close it is what surfaced this. Copies only when the paths genuinely differ, so a future matrix row that names them apart still works, and adds a guard that names a missing binary instead of leaving the next reader to decode cp's error. Verified against all three cases before commit: same-path skips and succeeds, different-path copies, absent-binary fails with ::error::. Refs #362 --- .github/workflows/release.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afd8ab66..538a4902 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,9 +81,17 @@ jobs: ART: ${{ matrix.artifact }} run: | bun run --filter @tpsdev-ai/cli build:binary:${TARGET#bun-} - # The build script outputs to dist/tps-, copy to artifact name - cp packages/cli/dist/tps-${TARGET#bun-} packages/cli/dist/${ART} - sha256sum packages/cli/dist/${ART} > packages/cli/dist/${ART}.sha256 + # build-portable.ts writes dist/tps- (the target minus its "bun-" + # prefix). Every matrix row sets artifact to exactly that name, so SRC and DST + # are the SAME FILE and an unconditional cp fails with "are the same file", + # exit 1. That is what broke the v0.6.0 run — and it would have broken every + # release since the output path settled, had one been cut. Copy only when the + # paths genuinely differ, so a future matrix row that names them apart works. + SRC="packages/cli/dist/tps-${TARGET#bun-}" + DST="packages/cli/dist/${ART}" + [ "$SRC" = "$DST" ] || cp "$SRC" "$DST" + test -f "$DST" || { echo "::error::expected binary missing at $DST"; exit 1; } + sha256sum "$DST" > "$DST.sha256" - name: Stage binary env: PKG: ${{ matrix.pkg }}