From 03acc8be012f2434c06da11f49857402e285765d Mon Sep 17 00:00:00 2001 From: yougotwill Date: Mon, 10 Feb 2025 16:50:08 +1100 Subject: [PATCH] fix: use separate jobs for building arm64 and x64 otherwise we cannot upload the artefacts separately so that autoupdate can find it easily --- .github/workflows/build-binaries.yml | 53 ++++++++++++++++++++++++++-- package.json | 26 ++------------ 2 files changed, 52 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index dae21d2df..155c31391 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -117,11 +117,11 @@ jobs: run: yarn build-release-publish # No other args needed for windows publish # We want both arm64 and intel mac builds, and according to this https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources macos-14 and above is always arm64 and macos-13 is the last intel runner - build_macos: + build_macos_arm64: runs-on: macos-14 strategy: matrix: - arch: [arm64, x64] + arch: [arm64] env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} MAC_CERTIFICATE: ${{ secrets.MAC_CERTIFICATE }} @@ -138,7 +138,54 @@ jobs: - name: Setup & Build uses: ./actions/setup_and_build with: - cache_suffix: ${{ matrix.os }} + cache_suffix: ${{ matrix.os }}-${{ matrix.arch }} + + # we want to test on all platforms since some are testing the rendered menus (and are dependent on the platform) + - name: Unit Test + run: yarn test + + - name: Build but do not publish + # we want this to run always, except on "push" to "master" + if: ${{ env.SHOULD_PUBLISH == 'false' }} + run: | + source ./build/setup-mac-certificate.sh + yarn build-release --config.mac.bundleVersion=${{ github.ref }} + + - name: Upload artefacts + # we want this to run always, except on "push" to "master" + if: ${{ env.SHOULD_PUBLISH == 'false' }} + uses: ./actions/upload_prod_artefacts + with: + upload_prefix: ${{ matrix.os }}-${{ matrix.arch }} + + - name: Build & publish + # we want this to run only when on "push" to "master" + if: ${{ env.SHOULD_PUBLISH == 'true' }} + run: | + source ./build/setup-mac-certificate.sh + yarn build-release-publish --config.mac.bundleVersion=${{ github.ref }} + build_macos_x64: + runs-on: macos-13 + strategy: + matrix: + arch: [x64] + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MAC_CERTIFICATE: ${{ secrets.MAC_CERTIFICATE }} + MAC_CERTIFICATE_PASSWORD: ${{ secrets.MAC_CERTIFICATE_PASSWORD }} + SIGNING_APPLE_ID: ${{ secrets.SIGNING_APPLE_ID }} + SIGNING_APP_PASSWORD: ${{ secrets.SIGNING_APP_PASSWORD }} + SIGNING_TEAM_ID: ${{ secrets.SIGNING_TEAM_ID }} + steps: + - run: git config --global core.autocrlf false + + - name: Checkout git repo + uses: actions/checkout@v4 + + - name: Setup & Build + uses: ./actions/setup_and_build + with: + cache_suffix: ${{ matrix.os }}-${{ matrix.arch }} # we want to test on all platforms since some are testing the rendered menus (and are dependent on the platform) - name: Unit Test diff --git a/package.json b/package.json index 2cb833beb..8936098a1 100644 --- a/package.json +++ b/package.json @@ -227,30 +227,8 @@ "category": "public.app-category.social-networking", "icon": "build/icon-mac.icns", "target": [ - { - "target": "dmg", - "arch": [ - "arm64" - ] - }, - { - "target": "zip", - "arch": [ - "arm64" - ] - }, - { - "target": "dmg", - "arch": [ - "x64" - ] - }, - { - "target": "zip", - "arch": [ - "x64" - ] - } + "dmg", + "zip" ], "bundleVersion": "1", "hardenedRuntime": true,