@@ -3,13 +3,13 @@ name: Reusable Release
33on :
44 workflow_call :
55 inputs :
6- skipable :
7- required : false
8- type : boolean
9- default : false
106 target :
117 required : true
128 type : string
9+ runner :
10+ default : " ubuntu-22.04"
11+ required : false
12+ type : string
1313 full-install :
1414 default : true
1515 required : false
@@ -41,7 +41,7 @@ permissions:
4141jobs :
4242 build :
4343 name : Build
44- runs-on : ${{ fromJSON( inputs.runner) }}
44+ runs-on : ${{ inputs.runner }}
4545 defaults :
4646 run :
4747 shell : bash
@@ -53,21 +53,18 @@ jobs:
5353 with :
5454 ref : ${{ inputs.ref }}
5555
56- - name : Clean
57- uses : ./.github/actions/clean
58- with :
59- target : ${{ inputs.target }}
60-
6156 - name : Pnpm Setup
6257 uses : ./.github/actions/pnpm
6358
6459 - uses : Boshen/setup-rust@main
6560 with :
61+ save-cache : true
6662 cache-key : build-${{ inputs.target }}-${{ inputs.profile }}
6763
6864 - name : Trim paths
6965 shell : bash
7066 run : |
67+ mkdir -p .cargo
7168 echo $'\n' >> .cargo/config.toml
7269 echo '[unstable]' >> .cargo/config.toml
7370 echo 'trim-paths = true' >> .cargo/config.toml
@@ -129,21 +126,21 @@ jobs:
129126 # Windows
130127 - name : Build i686-pc-windows-msvc
131128 if : ${{ inputs.target == 'i686-pc-windows-msvc' }}
132- run : RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }}
129+ run : RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
133130
134131 - name : Build x86_64-pc-windows-msvc
135132 if : ${{ inputs.target == 'x86_64-pc-windows-msvc' }}
136- run : RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }}
133+ run : RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
137134
138135 - name : Build aarch64-pc-windows-msvc
139136 if : ${{ inputs.target == 'aarch64-pc-windows-msvc' }}
140- run : RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }}
137+ run : RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
141138
142139 # Mac
143140 - name : Build x86_64-apple-darwin
144141 if : ${{ inputs.target == 'x86_64-apple-darwin' }}
145142 run : |
146- RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }}
143+ RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
147144
148145 - name : Build aarch64-apple-darwin
149146 if : ${{ inputs.target == 'aarch64-apple-darwin' }}
@@ -153,17 +150,15 @@ jobs:
153150 export CXX=$(xcrun -f clang++);
154151 SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
155152 export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
156- RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }}
153+ RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }}
157154
158155 - name : Upload artifact
159156 id : upload-artifact
160157 uses : ./.github/actions/artifact/upload
161158 if : ${{ inputs.target != 'wasm32-wasip1-threads' }}
162159 with :
163160 name : bindings-${{ inputs.target }}
164- path : crates/node_binding/*.node
165- try-local-cache : ${{ inputs.profile == 'ci' }}
166- mv-when-local : true
161+ path : napi/resolver*.node
167162
168163 # WASM
169164 - name : Build wasm32-wasip1-threads with linux in Docker
@@ -182,6 +177,4 @@ jobs:
182177 if : ${{ inputs.target == 'wasm32-wasip1-threads' }}
183178 with :
184179 name : bindings-wasm32-wasi
185- path : crates/node_binding/rspack.wasm32-wasi.wasm
186- try-local-cache : ${{ inputs.profile == 'ci' }}
187- mv-when-local : true
180+ path : napi/resolver*.wasm
0 commit comments