Skip to content

Commit ed275f6

Browse files
committed
build: fix reqwest build on Linux
1 parent 8bbeb70 commit ed275f6

7 files changed

Lines changed: 218 additions & 39 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ permissions: {}
77

88
jobs:
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

Cargo.lock

Lines changed: 173 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ rand = "0.9.1"
9898
ratatui = "0.29.0"
9999
rayon = "1.10.0"
100100
ref-cast = "1.0.24"
101-
reqwest = { version = "0.12", features = ["stream", "native-tls", "json"], default-features = false }
101+
reqwest = { version = "0.12", default-features = false }
102102
rusqlite = "0.37.0"
103103
rustc-hash = "2.1.1"
104104
seccompiler = { git = "https://github.com/branchseer/seccompiler", branch = "seccomp-action-raw" }

0 commit comments

Comments
 (0)