Skip to content

Commit 3e2f328

Browse files
authored
chore: cross compile macos on ubuntu for Node (#117)
* cross compile mac * update * empty message * use == false
1 parent 30f7a7a commit 3e2f328

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

.github/workflows/release-node-bindings.yml

+13-19
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
settings:
40-
- host: macos-13
40+
- host: ubuntu-latest
4141
target: x86_64-apple-darwin
42-
- host: macos-14
42+
- host: ubuntu-latest
4343
target: aarch64-apple-darwin
4444
- host: ubuntu-latest
4545
target: x86_64-unknown-linux-gnu
@@ -72,37 +72,31 @@ jobs:
7272
- name: Install dependencies
7373
run: yarn install
7474
working-directory: bindings/node
75-
- name: Setup Zig (Linux only)
75+
- name: Setup Zig
7676
uses: goto-bus-stop/setup-zig@v2
7777
with:
7878
version: 0.13.0
7979

80-
# Binstall is only needed for install cross-compilation
81-
# tools on linux
82-
- name: Install Binstall (Linux only)
83-
if: runner.os == 'Linux'
80+
- name: Install Binstall
8481
uses: cargo-bins/cargo-binstall@main
8582

86-
- name: Install cargo-zigbuild (Linux only)
87-
if: runner.os == 'Linux'
83+
- name: Install cargo-zigbuild
8884
run: cargo binstall cargo-zigbuild -y
85+
8986
- name: Install cargo-xwin (Windows on Linux only)
90-
if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows')
87+
if: contains(matrix.settings.target, 'windows')
9188
run: cargo binstall cargo-xwin -y
92-
- name: Build (macOS)
93-
if: runner.os == 'macOS'
94-
run: |
95-
rustup target add ${{ matrix.settings.target }}
96-
yarn build --release --target ${{ matrix.settings.target }}
97-
working-directory: bindings/node
98-
- name: Build (Linux)
99-
if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows')
89+
90+
- name: Build (Mac and Linux)
91+
if: contains(matrix.settings.target, 'windows') == false
10092
run: yarn build --zig --release --target ${{ matrix.settings.target }}
10193
working-directory: bindings/node
94+
10295
- name: Build (Windows on Linux)
103-
if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows')
96+
if: contains(matrix.settings.target, 'windows')
10497
run: yarn build --release --target ${{ matrix.settings.target }}
10598
working-directory: bindings/node
99+
106100
- name: Upload artifact
107101
uses: actions/upload-artifact@v4
108102
with:

0 commit comments

Comments
 (0)