22env :
33 DEBUG : napi:*
44 APP_NAME : simple-git
5- MACOSX_DEPLOYMENT_TARGET : " 10.13"
5+ MACOSX_DEPLOYMENT_TARGET : ' 10.13'
6+ CARGO_INCREMENTAL : ' 1'
67permissions :
78 contents : write
89 id-token : write
@@ -19,7 +20,35 @@ permissions:
1920 - .editorconfig
2021 - docs/**
2122 pull_request : null
23+ concurrency :
24+ group : ${{ github.workflow }}-${{ github.ref }}
25+ cancel-in-progress : true
2226jobs :
27+ lint :
28+ name : Lint
29+ runs-on : ubuntu-latest
30+ steps :
31+ - uses : actions/checkout@v4
32+
33+ - name : Setup node
34+ uses : actions/setup-node@v4
35+ with :
36+ node-version : 22
37+ cache : ' yarn'
38+
39+ - name : Install
40+ uses : dtolnay/rust-toolchain@stable
41+ with :
42+ components : clippy, rustfmt
43+
44+ - name : Install dependencies
45+ run : yarn install
46+
47+ - name : Cargo fmt
48+ run : cargo fmt -- --check
49+
50+ - name : Clippy
51+ run : cargo clippy
2352 build :
2453 strategy :
2554 fail-fast : false
@@ -31,42 +60,26 @@ jobs:
3160 - host : windows-latest
3261 build : yarn build --target x86_64-pc-windows-msvc
3362 target : x86_64-pc-windows-msvc
63+ - host : windows-latest
64+ build : yarn build --target i686-pc-windows-msvc
65+ target : i686-pc-windows-msvc
3466 - host : ubuntu-latest
3567 target : x86_64-unknown-linux-gnu
36- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
37- build : |-
38- set -e &&
39- apt-get update &&
40- apt-get install perl -y &&
41- rustup target add x86_64-unknown-linux-gnu &&
42- cp /usr/lib/x86_64-linux-gnu/libz.a /usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot/lib &&
43- yarn build --target x86_64-unknown-linux-gnu
68+ build : |
69+ sudo ln -sf /usr/lib/x86_64-linux-gnu/libz.a /usr/lib
70+ TARGET_CC=clang yarn build --target x86_64-unknown-linux-gnu --use-napi-cross
4471 - host : ubuntu-latest
4572 target : x86_64-unknown-linux-musl
46- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
47- build : |-
48- set -e &&
49- apk add perl &&
50- yarn build
73+ build : yarn build --target x86_64-unknown-linux-musl -x
5174 - host : macos-latest
5275 target : aarch64-apple-darwin
5376 build : yarn build --target aarch64-apple-darwin
5477 - host : ubuntu-latest
5578 target : aarch64-unknown-linux-gnu
56- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
57- build : |-
58- set -e &&
59- apt-get update &&
60- apt-get install -y perl &&
61- unset CC_aarch64_unknown_linux_gnu &&
62- unset CXX_aarch64_unknown_linux_gnu &&
63- yarn build --target aarch64-unknown-linux-gnu
79+ build : TARGET_CC=clang yarn build --target aarch64-unknown-linux-gnu --use-napi-cross
6480 - host : ubuntu-latest
6581 target : armv7-unknown-linux-gnueabihf
66- setup : |
67- sudo apt-get update
68- sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libatomic1-armhf-cross -y
69- build : yarn build --target armv7-unknown-linux-gnueabihf --zig --zig-link-only
82+ build : yarn build --target armv7-unknown-linux-gnueabihf --use-napi-cross
7083 - host : ubuntu-latest
7184 target : aarch64-linux-android
7285 build : yarn build --target aarch64-linux-android
@@ -75,76 +88,68 @@ jobs:
7588 build : yarn build --target armv7-linux-androideabi
7689 - host : ubuntu-latest
7790 target : aarch64-unknown-linux-musl
78- docker : ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
79- build : |-
80- set -e &&
81- apk add perl &&
82- rustup target add aarch64-unknown-linux-musl &&
83- yarn build --target aarch64-unknown-linux-musl
91+ build : yarn build --target aarch64-unknown-linux-musl -x
8492 - host : ubuntu-latest
8593 target : s390x-unknown-linux-gnu
86- setup : |
87- sudo apt-get update
88- sudo apt-get install -y gcc-s390x-linux-gnu
8994 build : |
90- export CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc
91- yarn build --target s390x-unknown-linux-gnu
95+ export CC=clang
96+ export TARGET_CC=clang
97+ export CFLAGS="-fuse-ld=lld"
98+ yarn build --target s390x-unknown-linux-gnu --use-napi-cross
9299 - host : ubuntu-latest
93100 target : powerpc64le-unknown-linux-gnu
94- setup : |
95- sudo apt-get update
96- sudo apt-get install -y gcc-powerpc64le-linux-gnu
97101 build : |
98- export CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc
99- yarn build --target powerpc64le-unknown-linux-gnu
102+ export CC=clang
103+ export TARGET_CC=clang
104+ export CFLAGS="-fuse-ld=lld"
105+ yarn build --target powerpc64le-unknown-linux-gnu --use-napi-cross
100106 - host : windows-latest
101107 target : aarch64-pc-windows-msvc
102108 build : yarn build --target aarch64-pc-windows-msvc
103- name : stable - ${{ matrix.settings.target }} - node@20
109+ name : stable - ${{ matrix.settings.target }} - node@22
104110 runs-on : ${{ matrix.settings.host }}
105111 steps :
106112 - uses : actions/checkout@v4
107113 - name : Setup node
108114 uses : actions/setup-node@v4
109- if : ${{ !matrix.settings.docker }}
110115 with :
111- node-version : 20
116+ node-version : 22
112117 cache : yarn
113118 - name : Install
114119 uses : dtolnay/rust-toolchain@stable
115- if : ${{ !matrix.settings.docker }}
116120 with :
117121 toolchain : stable
118122 targets : ${{ matrix.settings.target }}
119- - name : Cache cargo registry
123+ - name : Cache cargo
120124 uses : actions/cache@v4
121125 with :
122126 path : |
123- ~/.cargo/registry
124- ~/.cargo/git
127+ ~/.cargo/registry/index/
128+ ~/.cargo/registry/cache/
129+ ~/.cargo/git/db/
130+ ~/.napi-rs
125131 .cargo-cache
126- target
127- key : ${{ matrix.settings.target }}-cargo-cache
132+ target/
133+ key : ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
134+ - uses : goto-bus-stop/setup-zig@v2
135+ if : ${{ contains(matrix.settings.target, 'musl') }}
136+ with :
137+ version : 0.14.1
138+ - name : Install cargo-zigbuild
139+ uses : taiki-e/install-action@v2
140+ if : ${{ contains(matrix.settings.target, 'musl') }}
141+ env :
142+ GITHUB_TOKEN : ${{ github.token }}
143+ with :
144+ tool : cargo-zigbuild
128145 - name : Setup toolchain
129146 run : ${{ matrix.settings.setup }}
130147 if : ${{ matrix.settings.setup }}
131148 shell : bash
132- - uses : goto-bus-stop/setup-zig@v2
133- if : ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
134- with :
135- version : 0.13.0
136149 - name : Install dependencies
137- run : yarn install --mode=skip-build --immutable
138- - name : Build in docker
139- uses : addnab/docker-run-action@v3
140- if : ${{ matrix.settings.docker }}
141- with :
142- image : ${{ matrix.settings.docker }}
143- options : " -v ${{ github.workspace }}/.cargo-cache/git:/usr/local/cargo/git -v ${{ github.workspace }}/.cargo-cache/registry:/usr/local/cargo/registry -v ${{ github.workspace }}:/build -w /build"
144- run : ${{ matrix.settings.build }}
150+ run : yarn install
145151 - name : Build
146152 run : ${{ matrix.settings.build }}
147- if : ${{ !matrix.settings.docker }}
148153 shell : bash
149154 - name : Upload artifact
150155 uses : actions/upload-artifact@v4
@@ -154,8 +159,8 @@ jobs:
154159 if-no-files-found : error
155160
156161 build-freebsd :
157- name : Build FreeBSD
158162 runs-on : ubuntu-latest
163+ name : Build FreeBSD
159164 steps :
160165 - uses : actions/checkout@v4
161166 - name : Build
@@ -166,13 +171,13 @@ jobs:
166171 RUSTUP_IO_THREADS : 1
167172 with :
168173 operating_system : freebsd
169- version : " 14.1 "
174+ version : ' 14.2 '
170175 memory : 8G
171176 cpu_count : 3
172- environment_variables : " DEBUG RUSTUP_IO_THREADS"
177+ environment_variables : ' DEBUG RUSTUP_IO_THREADS'
173178 shell : bash
174179 run : |
175- sudo pkg install -y -f curl node libnghttp2 npm perl5
180+ sudo pkg install -y -f curl node libnghttp2 npm cmake perl5
176181 sudo npm install -g yarn --ignore-scripts
177182 curl https://sh.rustup.rs -sSf --output rustup.sh
178183 sh rustup.sh -y --profile minimal --default-toolchain stable
@@ -181,15 +186,18 @@ jobs:
181186 rustc --version
182187 echo "~~~~ node -v ~~~~"
183188 node -v
189+ echo "~~~~ yarn --version ~~~~"
190+ yarn --version
184191 pwd
185192 ls -lah
186193 whoami
187194 env
195+ freebsd-version
188196 yarn install
189- yarn build --target x86_64-unknown-freebsd
190- rm -rf .yarn
197+ yarn build
191198 rm -rf node_modules
192199 rm -rf target
200+ rm -rf .yarn/cache
193201 - name : Upload artifact
194202 uses : actions/upload-artifact@v4
195203 with :
@@ -215,8 +223,8 @@ jobs:
215223 target : x86_64-pc-windows-msvc
216224 architecture : " x64"
217225 node :
218- - " 18"
219226 - " 20"
227+ - " 22"
220228 runs-on : ${{ matrix.settings.host }}
221229 steps :
222230 - uses : actions/checkout@v4
@@ -248,8 +256,8 @@ jobs:
248256 fail-fast : false
249257 matrix :
250258 node :
251- - " 18"
252259 - " 20"
260+ - " 22"
253261 runs-on : ubuntu-latest
254262 steps :
255263 - uses : actions/checkout@v4
@@ -277,6 +285,7 @@ jobs:
277285 name : Publish
278286 runs-on : ubuntu-latest
279287 needs :
288+ - lint
280289 - build-freebsd
281290 - test-macOS-windows-binding
282291 - test-linux-x64-gnu-binding
@@ -285,16 +294,16 @@ jobs:
285294 - name : Setup node
286295 uses : actions/setup-node@v4
287296 with :
288- node-version : 20
297+ node-version : 22
289298 cache : yarn
290299 - name : Install dependencies
291- run : yarn install --mode=skip-build --immutable
300+ run : yarn install
301+ - name : create npm dirs
302+ run : yarn napi create-npm-dirs
292303 - name : Download all artifacts
293304 uses : actions/download-artifact@v4
294305 with :
295306 path : artifacts
296- - name : create npm dirs
297- run : yarn napi create-npm-dir -t .
298307 - name : Move artifacts
299308 run : yarn artifacts
300309 - name : List packages
0 commit comments