@@ -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,22 @@ 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
78+ run : cargo build --manifest-path rewatch/Cargo.toml --target ${{ matrix.rust-target }} --release
7479
7580 - name : Copy rewatch exe to platform bin dir
7681 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
82+ cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch
83+ node scripts/copyExes.js --rewatch
8284
8385 - name : " Upload artifact: rewatch binary"
8486 uses : actions/upload-artifact@v4
8587 with :
86- name : rewatch-${{env.artifact_dir_name }}
87- path : ${{ env.artifact_dir_name }}
88+ name : rewatch-${{ matrix.node-target }}
89+ path : packages/@rescript/ ${{ matrix.node-target }}/bin/rewatch.exe
8890
8991 build-compiler :
9092 strategy :
@@ -95,21 +97,26 @@ jobs:
9597 ocaml_compiler : ocaml-variants.5.3.0+options,ocaml-option-static
9698 upload_binaries : true
9799 upload_libs : true
100+ node-target : linux-x64
98101 - os : ubuntu-24.04-arm # ARM
99102 ocaml_compiler : ocaml-variants.5.3.0+options,ocaml-option-static
100103 upload_binaries : true
101104 # Build the playground compiler and run the benchmarks on the fastest runner
102105 build_playground : true
103106 benchmarks : true
107+ node-target : linux-arm64
104108 - os : macos-13 # x64
105109 ocaml_compiler : 5.3.0
106110 upload_binaries : true
111+ node-target : darwin-x64
107112 - os : macos-14 # ARM
108113 ocaml_compiler : 5.3.0
109114 upload_binaries : true
115+ node-target : darwin-arm64
110116 - os : windows-latest
111117 ocaml_compiler : 5.3.0
112118 upload_binaries : true
119+ node-target : win32-x64
113120
114121 # Verify that the compiler still builds with older OCaml versions
115122 - os : ubuntu-24.04
@@ -144,9 +151,6 @@ jobs:
144151 cache : yarn
145152 node-version-file : .nvmrc
146153
147- - name : Get artifact dir name
148- run : node .github/workflows/get_artifact_dir_name.js
149-
150154 - name : Install dependencies (Linux)
151155 if : runner.os == 'Linux'
152156@@ -303,13 +307,13 @@ jobs:
303307 run : yarn install
304308
305309 - name : Copy compiler exes to platform bin dir
306- run : node ./ scripts/copyExes.js -compiler
310+ run : node scripts/copyExes.js - -compiler
307311
308312 - name : Restore ninja build cache
309313 id : ninja-build-cache
310314 uses : actions/cache@v4
311315 with :
312- path : ${{ env.artifact_dir_name }}/ninja.exe
316+ path : packages/@rescript/ ${{ matrix.node-target }}/bin /ninja.exe
313317 key : ninja-build-v1-${{ matrix.os }}-${{ hashFiles('ninja/src/**') }}
314318
315319 - name : Setup Python for ninja build
@@ -336,7 +340,7 @@ jobs:
336340
337341 - name : Copy ninja exe to platform bin dir
338342 if : steps.ninja-build-cache.outputs.cache-hit != 'true'
339- run : node ./ scripts/copyExes.js -ninja
343+ run : node scripts/copyExes.js - -ninja
340344
341345 - name : " Syntax: Run roundtrip tests"
342346 if : ${{ runner.os != 'Windows' }}
@@ -423,8 +427,8 @@ jobs:
423427 if : matrix.upload_binaries
424428 uses : actions/upload-artifact@v4
425429 with :
426- name : binaries-${{ env.artifact_dir_name }}
427- path : ${{ env.artifact_dir_name }}
430+ name : binaries-${{ matrix.node-target }}
431+ path : packages/@rescript/ ${{ matrix.node-target }}/bin
428432
429433 - name : " Upload artifacts: lib/ocaml"
430434 if : matrix.upload_libs
@@ -491,15 +495,15 @@ jobs:
491495 matrix :
492496 include :
493497 - os : macos-13
494- target : darwin-x64
498+ node- target : darwin-x64
495499 - os : macos-14
496- target : darwin-arm64
500+ node- target : darwin-arm64
497501 - os : ubuntu-24.04
498- target : linux-x64
502+ node- target : linux-x64
499503 - os : ubuntu-24.04-arm
500- target : linux-arm64
504+ node- target : linux-arm64
501505 - os : windows-latest
502- target : win32-x64
506+ node- target : win32-x64
503507
504508 runs-on : ${{ matrix.os }}
505509
@@ -535,7 +539,7 @@ jobs:
535539 run : |
536540 npm i --ignore-scripts --no-audit \
537541 rescript-${{ needs.package.outputs.rescript_version }}.tgz \
538- rescript-${{ matrix.target }}-${{ needs.package.outputs.rescript_version }}.tgz
542+ rescript-${{ matrix.node- target }}-${{ needs.package.outputs.rescript_version }}.tgz
539543 shell : bash
540544 working-directory : ${{ steps.tmp-dir.outputs.path }}
541545
0 commit comments