@@ -25,20 +25,39 @@ jobs:
2525 fail-fast : false
2626 matrix :
2727 include :
28+ # macOS — both archs build natively on arm64 runner
29+ - os : macos-latest
30+ target : aarch64-apple-darwin
31+
32+ # Linux (glibc) — native runners per arch
2833 - os : ubuntu-latest
2934 target : x86_64-unknown-linux-gnu
30- - os : ubuntu-latest
35+ - os : ubuntu-24.04-arm
3136 target : aarch64-unknown-linux-gnu
32- - os : macos-latest
33- target : aarch64-apple-darwin
37+
38+ # Linux (musl) — native runners per arch
39+ - os : ubuntu-latest
40+ target : x86_64-unknown-linux-musl
41+ - os : ubuntu-24.04-arm
42+ target : aarch64-unknown-linux-musl
43+
44+ # Windows — native runners per arch
3445 - os : windows-latest
3546 target : x86_64-pc-windows-msvc
47+ - os : windows-11-arm
48+ target : aarch64-pc-windows-msvc
3649 steps :
3750 - uses : actions/checkout@v4
3851
39- - uses : dtolnay/rust-toolchain@stable
52+ - name : Remove rust-toolchain.toml
53+ shell : bash
54+ run : rm -f rust-toolchain.toml
55+
56+ - uses : dtolnay/rust-toolchain@master
4057 with :
58+ toolchain : " 1.93"
4159 targets : ${{ matrix.target }}
60+ components : clippy,rustfmt
4261
4362 - uses : actions/setup-node@v4
4463 with :
@@ -51,16 +70,22 @@ jobs:
5170 working-directory : packages/auths-node
5271 run : pnpm install
5372
54- - name : Install cross-compilation tools (Linux ARM64)
55- if : matrix.target == 'aarch64-unknown-linux-gnu'
73+ - name : Install musl tools (Linux x64)
74+ if : matrix.target == 'x86_64-unknown-linux-musl'
75+ run : |
76+ sudo apt-get update
77+ sudo apt-get install -y musl-tools
78+
79+ - name : Install musl tools (Linux arm64)
80+ if : matrix.target == 'aarch64-unknown-linux-musl'
5681 run : |
5782 sudo apt-get update
58- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
83+ sudo apt-get install -y musl-tools
5984
6085 - name : Build native module
6186 working-directory : packages/auths-node
6287 env :
63- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : ${{ matrix.target == 'aarch64-unknown-linux-gnu' && 'aarch64-linux-gnu-gcc' || '' }}
88+ RUSTUP_TOOLCHAIN : " 1.93 "
6489 run : pnpm build -- --target ${{ matrix.target }}
6590
6691 - uses : actions/upload-artifact@v4
@@ -78,8 +103,12 @@ jobs:
78103 include :
79104 - os : ubuntu-latest
80105 artifact : bindings-x86_64-unknown-linux-gnu
81- - os : macos-14
106+ - os : ubuntu-24.04-arm
107+ artifact : bindings-aarch64-unknown-linux-gnu
108+ - os : macos-latest
82109 artifact : bindings-aarch64-apple-darwin
110+ - os : windows-latest
111+ artifact : bindings-x86_64-pc-windows-msvc
83112 steps :
84113 - uses : actions/checkout@v4
85114
@@ -108,9 +137,48 @@ jobs:
108137 working-directory : packages/auths-node
109138 run : pnpm test
110139
140+ universal-macos :
141+ name : Universal macOS binary
142+ needs : [build]
143+ runs-on : macos-latest
144+ steps :
145+ - uses : actions/checkout@v4
146+
147+ - uses : actions/setup-node@v4
148+ with :
149+ node-version : 22
150+
151+ - name : Install pnpm
152+ run : npm install -g pnpm
153+
154+ - name : Install dependencies
155+ working-directory : packages/auths-node
156+ run : pnpm install
157+
158+ - uses : actions/download-artifact@v4
159+ with :
160+ name : bindings-aarch64-apple-darwin
161+ path : packages/auths-node/artifacts
162+
163+ - uses : actions/download-artifact@v4
164+ with :
165+ name : bindings-x86_64-apple-darwin
166+ path : packages/auths-node/artifacts
167+
168+ - name : Build universal binary
169+ working-directory : packages/auths-node
170+ run : |
171+ pnpm artifacts
172+ pnpm universal
173+
174+ - uses : actions/upload-artifact@v4
175+ with :
176+ name : bindings-universal-apple-darwin
177+ path : packages/auths-node/auths.darwin-universal.node
178+
111179 publish :
112180 name : Publish to npm
113- needs : [build, test]
181+ needs : [build, test, universal-macos ]
114182 runs-on : ubuntu-latest
115183 if : startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'npm')
116184 permissions :
0 commit comments