From 98808dbcff28af591e5fa1d15a05ef1fd51ad368 Mon Sep 17 00:00:00 2001 From: Evan Hu Date: Fri, 27 Nov 2026 14:45:50 +0900 Subject: [PATCH 1/2] ci(release): prepend platform downloads table to GitHub Release notes --- .github/workflows/release.yml | 69 ++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 707d381b7..1e2dc2bb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -542,6 +542,72 @@ jobs: fi done ls -lh "$assets" + - name: Prepend platform downloads table to GitHub release notes + env: + TAG: ${{ needs.meta.outputs.tag }} + VERSION: ${{ needs.meta.outputs.version }} + run: | + set -euo pipefail + base="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}" + ed="nsgo-game-editor-${VERSION}" + cli="nsgo-game-${VERSION}" + + cat > "$RUNNER_TEMP/downloads-table.md" < "$RUNNER_TEMP/github-release-notes.md" + + # Keep the combined body (table + changelog) under GitHub Releases' 125,000-character limit. + max_chars=120000 + if [ "$(wc -m < "$RUNNER_TEMP/github-release-notes.md")" -gt "$max_chars" ]; then + footer="$(printf '\n\n---\n\n_Release notes truncated to fit GitHub'\''s 125,000-character limit. See the full section in [CHANGELOG.md](https://github.com/%s/blob/%s/CHANGELOG.md)._\n' "$GITHUB_REPOSITORY" "$TAG")" + keep=$((max_chars - ${#footer})) + awk -v keep="$keep" ' + { + add = length($0) + 1 + if (total + add > keep) exit + print + total += add + } + ' "$RUNNER_TEMP/github-release-notes.md" > "$RUNNER_TEMP/github-release-notes.truncated.md" + printf '%s' "$footer" >> "$RUNNER_TEMP/github-release-notes.truncated.md" + mv "$RUNNER_TEMP/github-release-notes.truncated.md" "$RUNNER_TEMP/github-release-notes.md" + fi - name: Publish GitHub Release env: MODE: ${{ needs.meta.outputs.mode }} @@ -552,6 +618,7 @@ jobs: set -euo pipefail if [ "$MODE" = "upload" ]; then gh release upload "$TAG" --repo "$GITHUB_REPOSITORY" --clobber "$RUNNER_TEMP"/assets/* + gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes-file "$RUNNER_TEMP/github-release-notes.md" exit 0 fi title="NSGo Game ${VERSION}" @@ -559,4 +626,4 @@ jobs: if [[ "$VERSION" == *-* ]]; then prerelease=(--prerelease) fi - gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --verify-tag --title "$title" --notes-file "$RUNNER_TEMP/release-notes.md" "${prerelease[@]}" "$RUNNER_TEMP"/assets/* + gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --verify-tag --title "$title" --notes-file "$RUNNER_TEMP/github-release-notes.md" "${prerelease[@]}" "$RUNNER_TEMP"/assets/* From bb5f5f4c70add9766dcc082cb3103c96d6687ce4 Mon Sep 17 00:00:00 2001 From: Evan Hu Date: Fri, 27 Nov 2026 14:54:44 +0900 Subject: [PATCH 2/2] ci(release): ship editor-only installers with top platform downloads table --- .../2026-11-27-release-editor-packages.md | 6 +- .github/workflows/release.yml | 76 ++----------------- changelog.d/release-editor-packages.md | 2 +- docs/en/editor.md | 2 +- docs/zh/editor.md | 2 +- 5 files changed, 12 insertions(+), 76 deletions(-) diff --git a/.agents/notes/implemented/architecture/2026-11-27-release-editor-packages.md b/.agents/notes/implemented/architecture/2026-11-27-release-editor-packages.md index 12af995d2..9722848be 100644 --- a/.agents/notes/implemented/architecture/2026-11-27-release-editor-packages.md +++ b/.agents/notes/implemented/architecture/2026-11-27-release-editor-packages.md @@ -8,15 +8,15 @@ Tagged releases of `nsgo-dev/game` previously created text-only GitHub Releases ## Decision -Add a thin desktop application entrypoint in `cmd/editor` (`cmd/editor/main.go` + `cmd/editor/nsgo.yaml`) and extend `.github/workflows/release.yml` to build, sign, verify, and attach full desktop installers for **NSGo Game Editor** alongside prebuilt `nsgo-game` CLI archives on every release. +Add a thin desktop application entrypoint in `cmd/editor` (`cmd/editor/main.go` + `cmd/editor/nsgo.yaml`) and extend `.github/workflows/release.yml` to build, sign, verify, and attach full desktop installers for **NSGo Game Editor** on every release (keeping CLI workflows integrated under `nsgo game` rather than publishing separate `nsgo-game` archives). ### Packaging and signing contract - `cmd/editor` delegates directly to `internal/gamecli.Run(editorArgs(os.Args[1:]))`, stripping macOS Finder's `-psn_*` flag so double-clicking the app opens the Start Screen while CLI invocations still accept project/scene/clip arguments. - `cmd/editor/nsgo.yaml` declares `id: dev.nsgo.game.editor`, `release.github: nsgo-dev/game`, and `updates.key` matching the organization-wide `NSGO_UPDATES_KEY` secret so `go tool nsgo build` emits signed `appcast-.xml` feeds, `install.sh`, `install.ps1`, and `.AppImage.zsync` files alongside every installer. -- `.github/workflows/release.yml` builds all six desktop targets on Depot runners (`depot-macos-15` for `macos_arm64`/`macos_x64` `.dmg`, `depot-ubuntu-24.04-4` for `linux_x64`/`linux_arm64` `.deb`/`.pkg.tar.gz`/`.AppImage` and `windows_x64`/`windows_arm64` `-setup.exe`), plus cross-compiled `nsgo-game` CLI archives for all six desktop OS/arch pairs. +- `.github/workflows/release.yml` builds all six desktop targets on Depot runners (`depot-macos-15` for `macos_arm64`/`macos_x64` `.dmg`, `depot-ubuntu-24.04-4` for `linux_x64`/`linux_arm64` `.deb`/`.pkg.tar.gz`/`.AppImage` and `windows_x64`/`windows_arm64` `-setup.exe`) and prepends a per-platform Downloads table to the GitHub Release body while keeping `release-notes.md` clean for in-app update prompts. - macOS builds import the organization's Developer ID certificate (`MACOS_CERTIFICATE`, `MACOS_CERTIFICATE_PASSWORD`, `vars.MACOS_SIGNING_IDENTITY`) and App Store Connect API key (`APPSTORE_API_KEY_P8`, `APPSTORE_API_KEY_ID`, `APPSTORE_API_ISSUER_ID`), passing them to `go tool nsgo build` for hardened-runtime signing, notarization, and stapling, then verify every `.app` and `.dmg` with `codesign`, `xcrun stapler validate`, and `spctl --assess`. Non-release fork PRs without secrets fall back to ad hoc signing while tagged releases and `workflow_dispatch` uploads fail fast if signing or update secrets are missing. -- `workflow_dispatch` with an optional existing `tag` input (`mode=upload`) allows building and attaching signed editor and CLI assets onto an already-published release (such as `v0.1.0`) via `gh release upload --clobber` without moving or recreating the immutable Go module tag. +- `workflow_dispatch` with an optional existing `tag` input (`mode=upload`) allows building and attaching signed editor assets onto an already-published release (such as `v0.1.0`) via `gh release upload --clobber` without moving or recreating the immutable Go module tag. ## Alternatives considered diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e2dc2bb2..a18ea9f49 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,12 +3,12 @@ name: Release # Runs the full test and cross-target check suite on release tags, builds signed desktop # installers for NSGo Game Editor (macOS signed & notarized with the org's Developer ID, # Linux .deb / .pkg.tar.gz / .AppImage + install scripts, Windows -setup.exe installers, -# plus signed update appcasts via NSGO_UPDATES_KEY) and cross-platform nsgo-game CLI -# archives, then publishes them on the GitHub Release with notes extracted from CHANGELOG.md. +# plus signed update appcasts via NSGO_UPDATES_KEY), then publishes them on the GitHub +# Release with a platform downloads table and notes extracted from CHANGELOG.md. # # Pull requests touching cmd/editor or this workflow build and sign (when org secrets are # available) without publishing. workflow_dispatch with an existing tag (for example v0.1.0) -# builds and uploads the editor and CLI assets onto that release without moving the tag. +# builds and uploads the editor assets onto that release without moving the tag. on: push: tags: @@ -20,7 +20,7 @@ on: workflow_dispatch: inputs: tag: - description: "Optional existing release tag (e.g. v0.1.0) to build and upload editor/CLI assets onto; leave empty to dry-run." + description: "Optional existing release tag (e.g. v0.1.0) to build and upload editor assets onto; leave empty to dry-run." required: false type: string @@ -437,59 +437,6 @@ jobs: rm -f "$NOTARY_KEY" security delete-keychain "$KEYCHAIN" - cli: - name: Build nsgo-game CLI - needs: meta - runs-on: depot-ubuntu-24.04-4 - timeout-minutes: 20 - steps: - - name: Check out - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Set up Go - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 - with: - go-version-file: go.mod - cache: true - cache-dependency-path: go.sum - - name: Build and archive nsgo-game for all desktop platforms - env: - VERSION: ${{ needs.meta.outputs.version }} - run: | - set -euo pipefail - out="$RUNNER_TEMP/cli" - mkdir -p "$out" - for pair in darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 windows/amd64 windows/arm64; do - goos="${pair%/*}" - goarch="${pair#*/}" - os_label="$goos" - [ "$goos" = "darwin" ] && os_label="macos" - arch_label="$goarch" - [ "$goarch" = "amd64" ] && arch_label="x64" - bin="nsgo-game" - [ "$goos" = "windows" ] && bin="nsgo-game.exe" - stage="$RUNNER_TEMP/stage-${os_label}-${arch_label}" - mkdir -p "$stage" - CGO_ENABLED=0 GOOS="$goos" GOARCH="$goarch" go build -trimpath -o "$stage/$bin" ./cmd/nsgo-game - base="nsgo-game-${VERSION}-${os_label}-${arch_label}" - if [ "$goos" = "windows" ]; then - (cd "$stage" && zip -q "$out/${base}.zip" "$bin") - (cd "$out" && sha256sum "${base}.zip" > "${base}.zip.sha256") - else - tar -C "$stage" -czf "$out/${base}.tar.gz" "$bin" - (cd "$out" && sha256sum "${base}.tar.gz" > "${base}.tar.gz.sha256") - fi - done - ls -lh "$out" - - name: Upload CLI archives - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - with: - name: cli-binaries - path: ${{ runner.temp }}/cli/ - retention-days: 7 - if-no-files-found: error - release: name: Publish release needs: @@ -498,12 +445,10 @@ jobs: - check - apple - editor - - cli if: >- always() && needs.meta.result == 'success' && needs.editor.result == 'success' && - needs.cli.result == 'success' && (needs.test.result == 'success' || needs.test.result == 'skipped') && (needs.check.result == 'success' || needs.check.result == 'skipped') && (needs.apple.result == 'success' || needs.apple.result == 'skipped') && @@ -521,14 +466,14 @@ jobs: - name: Download release assets uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: - pattern: "*" + pattern: "editor-*" path: ${{ runner.temp }}/downloads - name: Assemble and verify asset checksums run: | set -euo pipefail assets="$RUNNER_TEMP/assets" mkdir -p "$assets" - for dir in "$RUNNER_TEMP"/downloads/editor-* "$RUNNER_TEMP"/downloads/cli-binaries; do + for dir in "$RUNNER_TEMP"/downloads/editor-*; do [ -d "$dir" ] || continue cp -- "$dir"/* "$assets/" done @@ -550,7 +495,6 @@ jobs: set -euo pipefail base="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}" ed="nsgo-game-editor-${VERSION}" - cli="nsgo-game-${VERSION}" cat > "$RUNNER_TEMP/downloads-table.md" <