@@ -7,17 +7,21 @@ permissions: {}
77
88jobs :
99 build-rust :
10- runs-on : ubuntu-latest
10+ runs-on : ${{ matrix.settings.os }}
1111 permissions :
1212 contents : read
1313 strategy :
1414 fail-fast : false
1515 matrix :
16- target :
17- - aarch64-apple-darwin
18- - aarch64-unknown-linux-gnu
19- - x86_64-unknown-linux-gnu
20- - x86_64-pc-windows-msvc
16+ settings :
17+ - target : aarch64-apple-darwin
18+ os : namespace-profile-mac-default
19+ - target : aarch64-unknown-linux-gnu
20+ os : ubuntu-latest
21+ - target : x86_64-unknown-linux-gnu
22+ os : ubuntu-latest
23+ - target : x86_64-pc-windows-msvc
24+ os : windows-latest
2125 # - aarch64-pc-windows-msvc
2226 steps :
2327 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -30,55 +34,39 @@ jobs:
3034 save-cache : ${{ github.ref_name == 'main' }}
3135 cache-key : release
3236
33- - uses : mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5
34- with :
35- version : 0.15.2
36-
37- - uses : taiki-e/install-action@ad95d4e02e061d4390c4b66ef5ed56c7fee3d2ce # v2.58.17
38- env :
39- GITHUB_TOKEN : ${{ github.token }}
40- with :
41- tool : cargo-zigbuild
42-
43- - uses : taiki-e/install-action@ad95d4e02e061d4390c4b66ef5ed56c7fee3d2ce # v2.58.17
44- if : ${{ contains(matrix.target, 'windows') }}
45- env :
46- GITHUB_TOKEN : ${{ github.token }}
47- with :
48- tool : cargo-xwin
49-
50- - name : Install llvm
51- if : ${{ contains(matrix.target, 'windows') }}
52- run : brew install llvm
53-
5437 - name : Rustup Adds Target
55- run : rustup target add ${{ matrix.target }}
38+ run : rustup target add ${{ matrix.settings. target }}
5639
5740 - name : Add musl target (x86_64)
58- if : ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
41+ if : ${{ matrix.settings. target == 'x86_64-unknown-linux-gnu' }}
5942 run : rustup target add x86_64-unknown-linux-musl
6043
6144 - name : Add musl target (aarch64)
62- if : ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
45+ if : ${{ matrix.settings. target == 'aarch64-unknown-linux-gnu' }}
6346 run : rustup target add aarch64-unknown-linux-musl
6447
6548 - uses : oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
6649
6750 - name : Build
68- run : pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.target }} -x
51+ if : ${{ contains(matrix.settings.target, 'linux') }}
52+ run : pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.settings.target }} --use-napi-cross
6953 env :
70- XWIN_CACHE_DIR : ${{ github.workspace }}/.xwin-cache
54+ TARGET_CC : clang
55+
56+ - name : Build
57+ if : ${{ !contains(matrix.settings.target, 'linux') }}
58+ run : pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.settings.target }}
7159
7260 - name : Upload artifact
7361 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7462 with :
75- name : bindings-${{ matrix.target }}
63+ name : bindings-${{ matrix.settings. target }}
7664 path : ./packages/cli/binding/*.node
7765 if-no-files-found : error
7866
7967 - name : Upload cli dist
8068 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
81- if : ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
69+ if : ${{ matrix.settings. target == 'x86_64-unknown-linux-gnu' }}
8270 with :
8371 name : cli
8472 path : ./packages/cli/dist
0 commit comments