Skip to content

Commit

Permalink
Build macOS Arm64 on native CI runner
Browse files Browse the repository at this point in the history
  • Loading branch information
dfunckt committed Dec 21, 2023
1 parent d03ddbc commit 169f3c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
# --- custom environment
NODE_VERSION:
type: string
default: "18.x"
default: "18.18"
VERBOSE:
type: string
default: "true"
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 169f3c1

Please sign in to comment.