Use native ARM runner for Apple Silicon builds

Change-type: minor
This commit is contained in:
Akis Kesoglou 2023-12-21 14:59:48 +02:00
parent 2e3a75e685
commit 01a96bb6de
3 changed files with 9 additions and 11 deletions

View File

@ -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,29 +122,27 @@ 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
SHA256SUM_BIN=sha256sum
#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
@ -162,7 +160,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
@ -181,7 +179,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

View File

@ -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

View File

@ -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"