authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-05 16:01:38-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-05 16:15:34-08:00
logb297e20f4e6e9a89d8f160e021b0b0f91248ca4f
tree78ff3abc18ff1eee6946b39ebdb44f0a21075e8c
parent44be7f3ac3b64f5bfc7c77bf159d457687f78300

Fix release target commit and gate version bump steps

- Set `target_commitish` from preflight ref when creating GitHub releases - Track whether package versions changed and expose it via step output - Run format, lockfile refresh, and bump commit only when changes exist

1 files changed, 9 insertions(+), 2 deletions(-)

.github/workflows/release.yml+9-2
......@@ -257,6 +257,7 @@ jobs:
257257 uses: softprops/action-gh-release@v2
258258 with:
259259 tag_name: ${{ needs.preflight.outputs.tag }}
260 target_commitish: ${{ needs.preflight.outputs.ref }}
260261 name: T3 Code v${{ needs.preflight.outputs.version }}
261262 generate_release_notes: true
262263 make_latest: true
......@@ -290,12 +291,13 @@ jobs:
290291 with:
291292 node-version-file: package.json
292293
293 - name: Update version strings
294 - id: update_versions
295 name: Update version strings
294296 env:
295297 RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
296298 run: |
297299 node --input-type=module -e '
298 import { readFileSync, writeFileSync } from "node:fs";
300 import { appendFileSync, readFileSync, writeFileSync } from "node:fs";
299301
300302 const files = [
301303 "apps/server/package.json",
......@@ -317,15 +319,20 @@ jobs:
317319 if (!changed) {
318320 console.log("All package.json versions already match release version.");
319321 }
322
323 appendFileSync(process.env.GITHUB_OUTPUT, `changed=${changed}\n`);
320324 '
321325
322326 - name: Format package.json files
327 if: steps.update_versions.outputs.changed == 'true'
323328 run: bunx oxfmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
324329
325330 - name: Refresh lockfile
331 if: steps.update_versions.outputs.changed == 'true'
326332 run: bun install
327333
328334 - name: Commit and push version bump
335 if: steps.update_versions.outputs.changed == 'true'
329336 shell: bash
330337 env:
331338 RELEASE_TAG: ${{ needs.preflight.outputs.tag }}