@@ -27,14 +27,19 @@ jobs:
2727 include :
2828 - os : macos-13 # x64
2929 rust-target : x86_64-apple-darwin
30+ node-target : darwin-x64
3031 - os : macos-14 # ARM
3132 rust-target : aarch64-apple-darwin
33+ node-target : darwin-arm64
3234 - os : ubuntu-24.04 # x64
3335 rust-target : x86_64-unknown-linux-musl
36+ node-target : linux-x64
3437 - os : ubuntu-24.04-arm # ARM
3538 rust-target : aarch64-unknown-linux-musl
39+ node-target : linux-arm64
3640 - os : windows-latest
3741 rust-target : x86_64-pc-windows-gnu
42+ node-target : win32-x64
3843
3944 runs-on : ${{matrix.os}}
4045
@@ -66,25 +71,20 @@ jobs:
6671 uses : dtolnay/rust-toolchain@master
6772 with :
6873 toolchain : stable
69- targets : ${{matrix.rust-target}}
74+ targets : ${{ matrix.rust-target }}
7075
7176 - name : Build rewatch
7277 if : steps.build-cache.outputs.cache-hit != 'true'
73- run : cargo build --manifest-path rewatch/Cargo.toml --target ${{matrix.rust-target}} --release
74-
75- - name : Copy rewatch exe to platform bin dir
7678 run : |
77- cp rewatch/target/${{matrix.rust-target}}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch
78- node ./scripts/copyExes.js -rewatch
79-
80- - name : Get artifact dir name
81- run : node .github/workflows/get_artifact_dir_name.js
79+ cargo build --manifest-path rewatch/Cargo.toml --target ${{ matrix.rust-target }} --release
80+ cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch.exe
81+ shell : bash
8282
8383 - name : " Upload artifact: rewatch binary"
8484 uses : actions/upload-artifact@v4
8585 with :
86- name : rewatch-${{env.artifact_dir_name }}
87- path : ${{ env.artifact_dir_name }}
86+ name : rewatch-${{ matrix.node-target }}
87+ path : rewatch.exe
8888
8989 build-compiler :
9090 strategy :
@@ -95,21 +95,26 @@ jobs:
9595 ocaml_compiler : ocaml-variants.5.3.0+options,ocaml-option-static
9696 upload_binaries : true
9797 upload_libs : true
98+ node-target : linux-x64
9899 - os : ubuntu-24.04-arm # ARM
99100 ocaml_compiler : ocaml-variants.5.3.0+options,ocaml-option-static
100101 upload_binaries : true
101102 # Build the playground compiler and run the benchmarks on the fastest runner
102103 build_playground : true
103104 benchmarks : true
105+ node-target : linux-arm64
104106 - os : macos-13 # x64
105107 ocaml_compiler : 5.3.0
106108 upload_binaries : true
109+ node-target : darwin-x64
107110 - os : macos-14 # ARM
108111 ocaml_compiler : 5.3.0
109112 upload_binaries : true
113+ node-target : darwin-arm64
110114 - os : windows-latest
111115 ocaml_compiler : 5.3.0
112116 upload_binaries : true
117+ node-target : win32-x64
113118
114119 # Verify that the compiler still builds with older OCaml versions
115120 - os : ubuntu-24.04
@@ -144,9 +149,6 @@ jobs:
144149 cache : yarn
145150 node-version-file : .nvmrc
146151
147- - name : Get artifact dir name
148- run : node .github/workflows/get_artifact_dir_name.js
149-
150152 - name : Install dependencies (Linux)
151153 if : runner.os == 'Linux'
152154@@ -303,13 +305,13 @@ jobs:
303305 run : yarn install
304306
305307 - name : Copy compiler exes to platform bin dir
306- run : node ./ scripts/copyExes.js -compiler
308+ run : node scripts/copyExes.js - -compiler
307309
308310 - name : Restore ninja build cache
309311 id : ninja-build-cache
310312 uses : actions/cache@v4
311313 with :
312- path : ${{ env.artifact_dir_name }}/ninja.exe
314+ path : packages/@rescript/ ${{ matrix.node-target }}/bin /ninja.exe
313315 key : ninja-build-v1-${{ matrix.os }}-${{ hashFiles('ninja/src/**') }}
314316
315317 - name : Setup Python for ninja build
@@ -336,7 +338,7 @@ jobs:
336338
337339 - name : Copy ninja exe to platform bin dir
338340 if : steps.ninja-build-cache.outputs.cache-hit != 'true'
339- run : node ./ scripts/copyExes.js -ninja
341+ run : node scripts/copyExes.js - -ninja
340342
341343 - name : " Syntax: Run roundtrip tests"
342344 if : ${{ runner.os != 'Windows' }}
@@ -423,8 +425,8 @@ jobs:
423425 if : matrix.upload_binaries
424426 uses : actions/upload-artifact@v4
425427 with :
426- name : binaries-${{ env.artifact_dir_name }}
427- path : ${{ env.artifact_dir_name }}
428+ name : binaries-${{ matrix.node-target }}
429+ path : packages/@rescript/ ${{ matrix.node-target }}/bin
428430
429431 - name : " Upload artifacts: lib/ocaml"
430432 if : matrix.upload_libs
@@ -491,15 +493,15 @@ jobs:
491493 matrix :
492494 include :
493495 - os : macos-13
494- target : darwin-x64
496+ node- target : darwin-x64
495497 - os : macos-14
496- target : darwin-arm64
498+ node- target : darwin-arm64
497499 - os : ubuntu-24.04
498- target : linux-x64
500+ node- target : linux-x64
499501 - os : ubuntu-24.04-arm
500- target : linux-arm64
502+ node- target : linux-arm64
501503 - os : windows-latest
502- target : win32-x64
504+ node- target : win32-x64
503505
504506 runs-on : ${{ matrix.os }}
505507
@@ -535,7 +537,7 @@ jobs:
535537 run : |
536538 npm i --ignore-scripts --no-audit \
537539 rescript-${{ needs.package.outputs.rescript_version }}.tgz \
538- rescript-${{ matrix.target }}-${{ needs.package.outputs.rescript_version }}.tgz
540+ rescript-${{ matrix.node- target }}-${{ needs.package.outputs.rescript_version }}.tgz
539541 shell : bash
540542 working-directory : ${{ steps.tmp-dir.outputs.path }}
541543
0 commit comments