From 0fb8586d09bca61480a521a637924f2e64bbc67e Mon Sep 17 00:00:00 2001 From: Ewy Date: Sat, 26 Sep 2026 19:57:03 +0200 Subject: [PATCH] Restore packages before bundling the macOS app, and let the macOS release job be re-run --- .github/workflows/dotnet.yml | 5 +++-- .github/workflows/release.yaml | 10 ++++++++-- packaging/macos/build-mac-app.sh | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 8488186..6e0b273 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -64,10 +64,11 @@ jobs: uses: actions/setup-dotnet@v6 with: dotnet-version: 10.0.x - - name: Test - run: dotnet test --verbosity normal + # Before the tests, so it runs on an unrestored checkout as the release job does. - name: Build the macOS app run: packaging/macos/build-mac-app.sh --no-dmg + - name: Test + run: dotnet test --verbosity normal - name: Check the app bundle run: | app="artifacts/macos/KSP2 Redux.app" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 54a604a..93bfd99 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,6 +3,8 @@ name: Build and Release on: push: branches: [ "main" ] + # Rebuilds the macOS assets for a release that already exists, when the macOS job failed after publishing. + workflow_dispatch: jobs: build: @@ -109,12 +111,12 @@ jobs: # the macOS asset names contain neither. macos-runtime: needs: build - if: needs.build.outputs.tag_exists == 'false' + if: needs.build.outputs.tag_exists == 'false' || github.event_name == 'workflow_dispatch' uses: ./.github/workflows/macos-runtime.yml macos: needs: [ build, macos-runtime ] - if: needs.build.outputs.tag_exists == 'false' + if: needs.build.outputs.tag_exists == 'false' || github.event_name == 'workflow_dispatch' runs-on: macos-15 permissions: contents: write @@ -155,6 +157,10 @@ jobs: dxmt="$(jq -r .dxmt <<< "$runtime_json")" notes="$(gh release view "$TAG" --json body --jq .body)" + if grep -q '^### macOS runtime' <<< "$notes"; then + echo "The release notes already have the macOS section." + exit 0 + fi { printf '%s\n\n' "$notes" printf '### macOS\n\n' diff --git a/packaging/macos/build-mac-app.sh b/packaging/macos/build-mac-app.sh index e996e32..4186227 100755 --- a/packaging/macos/build-mac-app.sh +++ b/packaging/macos/build-mac-app.sh @@ -32,7 +32,7 @@ while [ $# -gt 0 ]; do done echo "==> Building the launcher .app ($RID)" -dotnet msbuild "$PROJECT" -t:BundleApp -p:RuntimeIdentifier="$RID" -p:Configuration=Release \ +dotnet msbuild "$PROJECT" -restore -t:BundleApp -p:RuntimeIdentifier="$RID" -p:Configuration=Release \ -p:SelfContained=true -p:PublishSingleFile=false -v:minimal -nologo PUBLISH_DIR="$REPO_ROOT/src/Ksp2Redux.Tools.Launcher/bin/Release/net10.0/$RID/publish"