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:...@@ -257,6 +257,7 @@ jobs:
257 uses: softprops/action-gh-release@v2257 uses: softprops/action-gh-release@v2
258 with:258 with:
259 tag_name: ${{ needs.preflight.outputs.tag }}259 tag_name: ${{ needs.preflight.outputs.tag }}
260 target_commitish: ${{ needs.preflight.outputs.ref }}
260 name: T3 Code v${{ needs.preflight.outputs.version }}261 name: T3 Code v${{ needs.preflight.outputs.version }}
261 generate_release_notes: true262 generate_release_notes: true
262 make_latest: true263 make_latest: true
...@@ -290,12 +291,13 @@ jobs:...@@ -290,12 +291,13 @@ jobs:
290 with:291 with:
291 node-version-file: package.json292 node-version-file: package.json
292293
293 - name: Update version strings294 - id: update_versions
295 name: Update version strings
294 env:296 env:
295 RELEASE_VERSION: ${{ needs.preflight.outputs.version }}297 RELEASE_VERSION: ${{ needs.preflight.outputs.version }}
296 run: |298 run: |
297 node --input-type=module -e '299 node --input-type=module -e '
298 import { readFileSync, writeFileSync } from "node:fs";300 import { appendFileSync, readFileSync, writeFileSync } from "node:fs";
299301
300 const files = [302 const files = [
301 "apps/server/package.json",303 "apps/server/package.json",
...@@ -317,15 +319,20 @@ jobs:...@@ -317,15 +319,20 @@ jobs:
317 if (!changed) {319 if (!changed) {
318 console.log("All package.json versions already match release version.");320 console.log("All package.json versions already match release version.");
319 }321 }
322
323 appendFileSync(process.env.GITHUB_OUTPUT, `changed=${changed}\n`);
320 '324 '
321325
322 - name: Format package.json files326 - name: Format package.json files
327 if: steps.update_versions.outputs.changed == 'true'
323 run: bunx oxfmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json328 run: bunx oxfmt apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json
324329
325 - name: Refresh lockfile330 - name: Refresh lockfile
331 if: steps.update_versions.outputs.changed == 'true'
326 run: bun install332 run: bun install
327333
328 - name: Commit and push version bump334 - name: Commit and push version bump
335 if: steps.update_versions.outputs.changed == 'true'
329 shell: bash336 shell: bash
330 env:337 env:
331 RELEASE_TAG: ${{ needs.preflight.outputs.tag }}338 RELEASE_TAG: ${{ needs.preflight.outputs.tag }}