6161 run : git diff --exit-code ./docs/README.md
6262
6363 binary :
64- name : binary for ${{ matrix.name }}
64+ name : ${{ matrix.name }}
6565 if : github.event_name == 'push' || github.event_name == 'pull_request' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'hive-router-v'))
6666 runs-on : ${{ matrix.action_runner }}
6767 strategy :
@@ -111,11 +111,23 @@ jobs:
111111 run : cargo build --release --target ${{ matrix.rust_target }}
112112 if : ${{ !matrix.zigbuild }}
113113
114+ # napi build will use zigbuild when cross compiling
115+ - name : node-addon build (${{ matrix.rust_target }})
116+ working-directory : lib/node-addon
117+ env :
118+ CROSS_COMPILE : ${{ matrix.zigbuild }}
119+ TARGET : ${{ matrix.rust_target }}
120+ run : |
121+ npm ci
122+ npm run build
123+
114124 - uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
115125 name : upload build artifact
116126 with :
117127 name : hive_router_${{ matrix.name }}
118- path : target/${{ matrix.rust_target }}/release/${{ env.BINARY_NAME }}
128+ path : |
129+ target/${{ matrix.rust_target }}/release/${{ env.BINARY_NAME }}
130+ lib/node-addon/${{ env.BINARY_NAME }}.*.node
119131 if-no-files-found : error
120132 - name : Upload binaries to release
121133 uses : svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
@@ -125,57 +137,12 @@ jobs:
125137 file : target/${{ matrix.rust_target }}/release/${{ env.BINARY_NAME }}
126138 asset_name : hive_router_${{ matrix.name }}
127139 tag : ${{ github.ref }}
128-
129- node-addon :
130- name : node-addon for ${{ matrix.name }}
131- if : github.event_name == 'push' || github.event_name == 'pull_request' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'hive-router-v'))
132- runs-on : ${{ matrix.action_runner }}
133- strategy :
134- fail-fast : false # TODO: linux arm build fails
135- matrix :
136- include :
137- - name : linux_arm64
138- rust_target : aarch64-unknown-linux-gnu
139- action_runner : ubuntu-latest
140- - name : linux_amd64
141- rust_target : x86_64-unknown-linux-gnu
142- action_runner : ubuntu-latest
143- - name : macos_arm64
144- rust_target : aarch64-apple-darwin
145- action_runner : macos-15
146- - name : macos_amd64
147- rust_target : x86_64-apple-darwin
148- action_runner : macos-15
149- steps :
150- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
151- name : checkout
152- - uses : actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
153- name : rust toolchain (${{ matrix.rust_target }})
154- with :
155- target : ${{ matrix.rust_target }}
156- cache-key : ${{ matrix.name }}
157- - name : napi-rs build (${{ matrix.rust_target }})
158- working-directory : lib/node-addon
159- env :
160- TARGET : ${{ matrix.rust_target }}
161- run : |
162- npm ci
163- npm run build
164- - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
165- name : upload build artifact
166- with :
167- name : hive_router_${{ matrix.name }}
168- # TODO: we dont use matrix.rust_target because napi-rs target is differenty named on output
169- path : lib/node-addon/${{ env.BINARY_NAME }}.*.node
170- if-no-files-found : error
171- - name : Upload binaries to release
140+ - name : Upload node addons to release
172141 uses : svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2
173142 if : ${{ github.event_name == 'release' }}
174143 with :
175144 repo_token : ${{ secrets.GITHUB_TOKEN }}
176- # TODO: we dont use matrix.rust_target because napi-rs target is differenty named on output
177145 file : lib/node-addon/${{ env.BINARY_NAME }}.*.node
178- asset_name : hive_router_${{ matrix.name }}
179146 tag : ${{ github.ref }}
180147
181148 docker :
0 commit comments