17
17
RUSTUP_MAX_RETRIES : 10
18
18
FETCH_DEPTH : 0 # pull in the tags for the version string
19
19
MACOSX_DEPLOYMENT_TARGET : 13.0
20
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-gcc
21
- CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER : arm-linux-gnueabihf-gcc
20
+ ZIG_VERSION : 0.13.0
21
+ ZIGBUILD_VERSION : 0.19.8
22
22
23
23
jobs :
24
24
dist :
25
- if : ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
25
+ if : ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
26
26
strategy :
27
27
matrix :
28
28
include :
@@ -36,13 +36,15 @@ jobs:
36
36
code-target : win32-arm64
37
37
- os : ubuntu-latest
38
38
target : x86_64-unknown-linux-gnu
39
+ zig_target : x86_64-unknown-linux-gnu.2.28
39
40
code-target : linux-x64
40
- container : rockylinux:8
41
41
- os : ubuntu-latest
42
42
target : aarch64-unknown-linux-gnu
43
+ zig_target : aarch64-unknown-linux-gnu.2.28
43
44
code-target : linux-arm64
44
45
- os : ubuntu-latest
45
46
target : arm-unknown-linux-gnueabihf
47
+ zig_target : arm-unknown-linux-gnueabihf.2.28
46
48
code-target : linux-armhf
47
49
- os : macos-13
48
50
target : x86_64-apple-darwin
@@ -64,40 +66,33 @@ jobs:
64
66
with :
65
67
fetch-depth : ${{ env.FETCH_DEPTH }}
66
68
67
- - name : Install toolchain dependencies
68
- if : matrix.container == 'rockylinux:8'
69
- shell : bash
70
- run : |
71
- dnf install -y gcc
72
- curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
73
- echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
69
+ - name : Install Node.js toolchain
70
+ uses : actions/setup-node@v4
71
+ with :
72
+ node-version : 22
74
73
75
74
- name : Install Rust toolchain
76
75
run : |
77
76
rustup update --no-self-update stable
78
- rustup target add ${{ matrix.target }}
79
77
rustup component add rust-src
78
+ rustup target add ${{ matrix.target }}
80
79
81
- - name : Install Node.js
82
- uses : actions/setup-node@v4
83
- with :
84
- node-version : 18
85
-
86
- - name : Update apt repositories
87
- if : matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
88
- run : sudo apt-get update
89
-
90
- - name : Install AArch64 target toolchain
91
- if : matrix.target == 'aarch64-unknown-linux-gnu'
92
- run : sudo apt-get install gcc-aarch64-linux-gnu
93
-
94
- - name : Install ARM target toolchain
95
- if : matrix.target == 'arm-unknown-linux-gnueabihf'
96
- run : sudo apt-get install gcc-arm-linux-gnueabihf
80
+ - name : Install Zig toolchain
81
+ if : ${{ matrix.zig_target }}
82
+ run : |
83
+ which cargo
84
+ curl -L "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz" | sudo tar JxC /usr/local
85
+ sudo ln -s "/usr/local/zig-linux-$(uname -m)-${ZIG_VERSION}/zig" /usr/local/bin/zig
86
+ curl -L "https://github.com./rust-cross/cargo-zigbuild/releases/download/v${ZIGBUILD_VERSION}/cargo-zigbuild-v${ZIGBUILD_VERSION}.x86_64-unknown-linux-musl.tar.gz" | tar zxC ~/.cargo/bin
97
87
98
- - name : Dist
88
+ - name : Dist (plain)
89
+ if : ${{ !matrix.zig_target }}
99
90
run : cargo xtask dist --client-patch-version ${{ github.run_number }}
100
91
92
+ - name : Dist (using zigbuild)
93
+ if : ${{ matrix.zig_target }}
94
+ run : RA_TARGET=${{ matrix.zig_target}} cargo xtask dist --client-patch-version ${{ github.run_number }} --zig
95
+
101
96
- run : npm ci
102
97
working-directory : editors/code
103
98
@@ -139,7 +134,7 @@ jobs:
139
134
path : ./dist
140
135
141
136
dist-x86_64-unknown-linux-musl :
142
- if : ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
137
+ if : ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
143
138
name : dist (x86_64-unknown-linux-musl)
144
139
runs-on : ubuntu-latest
145
140
env :
@@ -185,15 +180,15 @@ jobs:
185
180
path : ./dist
186
181
187
182
publish :
188
- if : ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
183
+ if : ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
189
184
name : publish
190
185
runs-on : ubuntu-latest
191
186
needs : ["dist", "dist-x86_64-unknown-linux-musl"]
192
187
steps :
193
188
- name : Install Nodejs
194
189
uses : actions/setup-node@v4
195
190
with :
196
- node-version : 20
191
+ node-version : 22
197
192
198
193
- run : echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
199
194
if : github.ref == 'refs/heads/release'
0 commit comments