Skip to content

Commit

Permalink
Build ppx for macOS x64
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyThat committed Sep 20, 2024
1 parent d954d93 commit 0f1eae0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,37 @@ jobs:
path: packages/rescript-schema-ppx/src/_build/default/bin/bin.exe
if-no-files-found: error

ppx-build-macos-x64:
name: ppx-build-macos-x64
runs-on: macOS-13
defaults:
run:
working-directory: packages/rescript-schema-ppx/src
strategy:
matrix:
ocaml-compiler:
- 4.12.1
steps:
- uses: actions/checkout@v3

- name: Use OCaml ${{ matrix.ocaml-compiler}}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Install deps
run: opam install . --deps-only --with-test

- name: Build
run: opam exec -- dune build

- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: ppx-build-macos-x64
path: packages/rescript-schema-ppx/src/_build/default/bin/bin.exe
if-no-files-found: error

ppx-build-windows:
name: ppx-build-windows
runs-on: windows-latest
Expand Down Expand Up @@ -168,7 +199,8 @@ jobs:

pack-rescript-schema-ppx:
name: Pack rescript-schema-ppx
needs: [ppx-build-linux, ppx-build-macos, ppx-build-windows]
needs:
[ppx-build-linux, ppx-build-macos, ppx-build-macos-x64, ppx-build-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -191,6 +223,12 @@ jobs:
name: ppx-build-macos
path: binaries/macos

- name: Download macOS x64 artifacts
uses: actions/download-artifact@master
with:
name: ppx-build-macos-x64
path: binaries/macos-x64

- name: Download windows artifacts
uses: actions/download-artifact@master
with:
Expand All @@ -201,6 +239,7 @@ jobs:
run: |
mv binaries/linux/bin.exe packages/rescript-schema-ppx/ppx-linux.exe
mv binaries/macos/bin.exe packages/rescript-schema-ppx/ppx-osx.exe
mv binaries/macos-x64/bin.exe packages/rescript-schema-ppx/ppx-osx-x64.exe
mv binaries/windows/bin.exe packages/rescript-schema-ppx/ppx-windows.exe
- name: npm pack (rescript-schema-ppx)
Expand Down
5 changes: 3 additions & 2 deletions packages/rescript-schema-ppx/install.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ switch (process.platform) {
installMacLinuxBinary("ppx-linux.exe");
break;
case "darwin":
installMacLinuxBinary("ppx-osx.exe");
break;
const binaryName =
process.arch === "x64" ? "ppx-osx-x64.exe" : "ppx-osx.exe";
installMacLinuxBinary(binaryName);
case "win32":
installWindowsBinary();
break;
Expand Down

0 comments on commit 0f1eae0

Please sign in to comment.