From 169f3c15a08e9a2b34d656a1f5dd4f49993ea8f1 Mon Sep 17 00:00:00 2001 From: Akis Kesoglou Date: Thu, 21 Dec 2023 14:59:48 +0200 Subject: [PATCH] Build macOS Arm64 on native CI runner --- .github/actions/publish/action.yml | 14 ++++++-------- .github/actions/test/action.yml | 4 ++-- .github/workflows/flowzone.yml | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index bac950c6858..a0493d96b7d 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -27,7 +27,7 @@ runs: - name: Download custom source artifact uses: actions/download-artifact@v4 with: - name: custom-${{ github.event.pull_request.head.sha || github.event.head_commit.id }}-${{ runner.os }} + name: custom-${{ github.event.pull_request.head.sha || github.event.head_commit.id }}-${{ runner.os }}-${{ runner.arch }} path: ${{ runner.temp }} - name: Extract custom source artifact @@ -122,28 +122,26 @@ runs: fi APPLICATION_VERSION="$(jq -r '.version' package.json)" + HOST_ARCH="$(echo "${RUNNER_ARCH}" | tr '[:upper:]' '[:lower:]')" if [[ "${RUNNER_OS}" == Linux ]]; then PLATFORM=Linux - BUILD_ARCHS="x64" SHA256SUM_BIN=sha256sum elif [[ "${RUNNER_OS}" == macOS ]]; then PLATFORM=Darwin - BUILD_ARCHS="x64,arm64" SHA256SUM_BIN='shasum -a 256' elif [[ "${RUNNER_OS}" == Windows ]]; then PLATFORM=Windows - #BUILD_ARCHS="ia32,x64" -- distutils fails to build for ia32 - BUILD_ARCHS="x64" else echo "ERROR: unexpected runner OS: ${RUNNER_OS}" exit 1 fi - npx electron-forge make --arch="${BUILD_ARCHS}" + # Currently, we can only build for the host architecture. + npx electron-forge make echo "version=${APPLICATION_VERSION}" >> $GITHUB_OUTPUT @@ -161,7 +159,7 @@ runs: if [[ -n "${SHA256SUM_BIN}" ]]; then # Compute and save digests. cd dist/ - ${SHA256SUM_BIN} *.* >"SHA256SUMS.${PLATFORM}.txt" + ${SHA256SUM_BIN} *.* >"SHA256SUMS.${PLATFORM}.${HOST_ARCH}.txt" fi env: # ensure we sign the artifacts @@ -180,7 +178,7 @@ runs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: gh-release-${{ github.event.pull_request.head.sha || github.event.head_commit.id }}-${{ runner.os }} + name: gh-release-${{ github.event.pull_request.head.sha || github.event.head_commit.id }}-${{ runner.os }}-${{ runner.arch }} path: dist retention-days: 1 if-no-files-found: error diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 4874faa1474..0d50b21c148 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -12,7 +12,7 @@ inputs: # --- custom environment NODE_VERSION: type: string - default: "18.x" + default: "18.18" VERBOSE: type: string default: "true" @@ -77,6 +77,6 @@ runs: - name: Upload custom artifact uses: actions/upload-artifact@v4 with: - name: custom-${{ github.event.pull_request.head.sha || github.event.head_commit.id }}-${{ runner.os }} + name: custom-${{ github.event.pull_request.head.sha || github.event.head_commit.id }}-${{ runner.os }}-${{ runner.arch }} path: ${{ runner.temp }}/custom.tgz retention-days: 1 diff --git a/.github/workflows/flowzone.yml b/.github/workflows/flowzone.yml index bac8c673c06..0bf3b02f820 100644 --- a/.github/workflows/flowzone.yml +++ b/.github/workflows/flowzone.yml @@ -18,7 +18,7 @@ jobs: (github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target') secrets: inherit with: - tests_run_on: '["ubuntu-20.04","macos-12","windows-2019"]' + tests_run_on: '["ubuntu-20.04","windows-2019","macos-12","macos-latest-xlarge"]' restrict_custom_actions: false github_prerelease: true cloudflare_website: "etcher"