Skip to content

Commit

Permalink
try using the hosted GH runner for macOS arm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed Feb 26, 2024
1 parent 4f125ab commit 0f5e2af
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ jobs:
build-ppx:
strategy:
matrix:
platform: [macos-latest, windows-latest]
platform: [
macos-13, # x64
macos-14, # ARM,
windows-latest,
]

name: Build PPX for release
runs-on: ${{ matrix.platform }}
Expand Down Expand Up @@ -202,14 +206,27 @@ jobs:

- uses: actions/download-artifact@v2
with:
name: ppx-macos-latest
name: ppx-macos-13
path: binaries

- uses: actions/download-artifact@v2
with:
name: ppx-macos-14
path: binaries

- uses: actions/download-artifact@v2
with:
name: ppx-windows-latest
path: binaries

- name: Rename MacOS old binary
run: |
mv binaries/ppx-macos-13 binaries/ppx-macos-latest
- name: Rename MacOS ARM64 binary
run: |
mv binaries/ppx-macos-14 binaries/ppx-macos-arm64
- name: Move binaries into release directory
run: |
mv binaries/* _release/
Expand All @@ -218,7 +235,8 @@ jobs:
with:
name: |
ppx-linux
ppx-macos-latest
ppx-macos-13
ppx-macos-14
ppx-windows-latest
relay-compiler-linux-x64
relay-compiler-macos-x64
Expand Down
Empty file.
Binary file removed packages/rescript-relay/binaries/ppx-macos-arm64
Binary file not shown.
17 changes: 7 additions & 10 deletions packages/rescript-relay/scripts/release-postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ function getRelayCompilerPlatformSuffix() {
*/

function ppxArch() {
/**
* Use Rosetta for ARM on macOS
*/
if (platform === "darwin" && process.arch === "arm64") {
return "arm64";
}
Expand Down Expand Up @@ -102,11 +99,8 @@ function copyPlatformBinaries(platform) {
const ppxFinalFilename = platform === "windows-latest" ? "ppx.exe" : "ppx";
const ppxFinalPath = path.join(__dirname, ppxFinalFilename);

if (!fs.existsSync(ppxFinalPath)){
fs.copyFileSync(
path.join(__dirname, "ppx-" + platform),
ppxFinalPath
);
if (!fs.existsSync(ppxFinalPath)) {
fs.copyFileSync(path.join(__dirname, "ppx-" + platform), ppxFinalPath);
}
fs.chmodSync(ppxFinalPath, 0777);

Expand All @@ -116,9 +110,12 @@ function copyPlatformBinaries(platform) {

var platformSuffix = getRelayCompilerPlatformSuffix();

const rescriptRelayCompilerFinalPath = path.join(__dirname, "rescript-relay-compiler.exe");
const rescriptRelayCompilerFinalPath = path.join(
__dirname,
"rescript-relay-compiler.exe"
);

if (!fs.existsSync(rescriptRelayCompilerFinalPath)){
if (!fs.existsSync(rescriptRelayCompilerFinalPath)) {
fs.copyFileSync(
path.join(
__dirname,
Expand Down

0 comments on commit 0f5e2af

Please sign in to comment.