@@ -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-24.04-arm
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
@@ -40,45 +44,37 @@ jobs:
4044 with :
4145 tool : cargo-zigbuild
4246
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-
5447 - name : Rustup Adds Target
55- run : rustup target add ${{ matrix.target }}
48+ run : rustup target add ${{ matrix.settings. target }}
5649
5750 - name : Add musl target (x86_64)
58- if : ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
51+ if : ${{ matrix.settings. target == 'x86_64-unknown-linux-gnu' }}
5952 run : rustup target add x86_64-unknown-linux-musl
6053
6154 - name : Add musl target (aarch64)
62- if : ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
55+ if : ${{ matrix.settings. target == 'aarch64-unknown-linux-gnu' }}
6356 run : rustup target add aarch64-unknown-linux-musl
6457
6558 - uses : oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
6659
6760 - name : Build
68- run : pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.target }} -x
69- env :
70- XWIN_CACHE_DIR : ${{ github.workspace }}/.xwin-cache
61+ if : ${{ contains(matrix.settings.target, 'linux') }}
62+ run : pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.settings.target }} --use-napi-cross
63+
64+ - name : Build
65+ if : ${{ !contains(matrix.settings.target, 'linux') }}
66+ run : pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.settings.target }}
7167
7268 - name : Upload artifact
7369 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7470 with :
75- name : bindings-${{ matrix.target }}
71+ name : bindings-${{ matrix.settings. target }}
7672 path : ./packages/cli/binding/*.node
7773 if-no-files-found : error
7874
7975 - name : Upload cli dist
8076 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
81- if : ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
77+ if : ${{ matrix.settings. target == 'x86_64-unknown-linux-gnu' }}
8278 with :
8379 name : cli
8480 path : ./packages/cli/dist
0 commit comments