Skip to content

Commit f0e9f27

Browse files
committed
ci(macos): fix release step — orphaned upload-artifact keys, idempotent publish
The retention-days/compression-level keys belonged to the upload-artifact step but landed inside the release step's run block, so they ran as shell ('retention-days: command not found', exit 127) and reddened the run even though the release published. Move them back under upload-artifact and make the release create-or-update so re-runs don't fail on an existing tag.
1 parent 9361132 commit f0e9f27

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/macos-build-gpu.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ jobs:
347347
name: engine-macos-arm64
348348
path: ${{ env.ENGINE_TARBALL }}
349349
if-no-files-found: error
350+
retention-days: 30
351+
compression-level: 0 # already gzip-compressed
350352

351353
# Publish a versioned GitHub Release per push so bar-lobby can consume the
352354
# engine as a public release asset (token-free) instead of a cross-repo
@@ -359,11 +361,14 @@ jobs:
359361
set -euo pipefail
360362
SHORT_SHA="$(echo "$GITHUB_SHA" | cut -c1-7)"
361363
TAG="engine-macos-arm64-${GITHUB_RUN_NUMBER}-g${SHORT_SHA}"
362-
gh release create "$TAG" "$ENGINE_TARBALL" \
363-
--repo "$GITHUB_REPOSITORY" \
364-
--target "$GITHUB_SHA" \
365-
--title "macOS arm64 engine — run ${GITHUB_RUN_NUMBER} (${SHORT_SHA})" \
366-
--notes "Self-contained Apple Silicon engine (Mesa 26.2 KosmicKrisp GPU) for bar-lobby. Built from ${GITHUB_SHA} on ${GITHUB_REF_NAME}." \
367-
--latest
368-
retention-days: 30
369-
compression-level: 0 # already gzip-compressed
364+
NOTES="Self-contained Apple Silicon engine (Mesa 26.2 KosmicKrisp GPU) for bar-lobby. Built from ${GITHUB_SHA} on ${GITHUB_REF_NAME}."
365+
TITLE="macOS arm64 engine — run ${GITHUB_RUN_NUMBER} (${SHORT_SHA})"
366+
# Idempotent: create the release, or (on a re-run with the same tag)
367+
# update its asset instead of failing.
368+
if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
369+
gh release upload "$TAG" "$ENGINE_TARBALL" --repo "$GITHUB_REPOSITORY" --clobber
370+
else
371+
gh release create "$TAG" "$ENGINE_TARBALL" \
372+
--repo "$GITHUB_REPOSITORY" --target "$GITHUB_SHA" \
373+
--title "$TITLE" --notes "$NOTES" --latest
374+
fi

0 commit comments

Comments
 (0)