8080 runner : windows-latest
8181 archive : zip
8282 build-tool : cargo
83+ - target : i686-pc-windows-msvc
84+ runner : windows-latest
85+ archive : zip
86+ build-tool : cargo
87+ - target : aarch64-pc-windows-msvc
88+ runner : windows-latest
89+ archive : zip
90+ build-tool : cargo
91+ - target : aarch64-linux-android
92+ runner : ubuntu-latest
93+ archive : tar.gz
94+ build-tool : cross
95+ - target : arm-unknown-linux-gnueabihf
96+ runner : ubuntu-latest
97+ archive : tar.gz
98+ build-tool : cross
99+ - target : i686-unknown-linux-gnu
100+ runner : ubuntu-latest
101+ archive : tar.gz
102+ build-tool : cross
83103 runs-on : ${{ matrix.runner }}
84104 steps :
85105 - name : Checkout
@@ -213,8 +233,10 @@ jobs:
213233 - name : Setup Node.js
214234 uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
215235 with :
216- node-version : ' 20'
217- registry-url : ' https://registry.npmjs.org'
236+ node-version : ' 22'
237+
238+ - name : Update npm for trusted publishing
239+ run : npm install -g npm@latest
218240
219241 - name : Stage binaries
220242 run : |
@@ -227,16 +249,24 @@ jobs:
227249 mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-linux-x64
228250 tar xzf artifacts/socket-patch-aarch64-unknown-linux-gnu.tar.gz -C npm/socket-patch/bin/
229251 mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-linux-arm64
252+ tar xzf artifacts/socket-patch-arm-unknown-linux-gnueabihf.tar.gz -C npm/socket-patch/bin/
253+ mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-linux-arm
254+ tar xzf artifacts/socket-patch-i686-unknown-linux-gnu.tar.gz -C npm/socket-patch/bin/
255+ mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-linux-ia32
256+ tar xzf artifacts/socket-patch-aarch64-linux-android.tar.gz -C npm/socket-patch/bin/
257+ mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-android-arm64
230258 cd npm/socket-patch/bin
231259 unzip ../../../artifacts/socket-patch-x86_64-pc-windows-msvc.zip
232260 mv socket-patch.exe socket-patch-win32-x64.exe
261+ unzip ../../../artifacts/socket-patch-i686-pc-windows-msvc.zip
262+ mv socket-patch.exe socket-patch-win32-ia32.exe
263+ unzip ../../../artifacts/socket-patch-aarch64-pc-windows-msvc.zip
264+ mv socket-patch.exe socket-patch-win32-arm64.exe
233265
234266 - name : Copy README for npm package
235267 run : cp README.md npm/socket-patch/README.md
236268
237269 - name : Publish package
238- env :
239- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
240270 run : npm publish ./npm/socket-patch --provenance --access public
241271
242272 pypi-publish :
@@ -262,38 +292,12 @@ jobs:
262292 with :
263293 python-version : ' 3.12'
264294
265- - name : Install build tools
266- run : pip install build
267-
268- - name : Stage binaries
269- run : |
270- mkdir -p pypi/socket-patch/socket_patch/bin
271- tar xzf artifacts/socket-patch-aarch64-apple-darwin.tar.gz -C pypi/socket-patch/socket_patch/bin/
272- mv pypi/socket-patch/socket_patch/bin/socket-patch pypi/socket-patch/socket_patch/bin/socket-patch-darwin-arm64
273- tar xzf artifacts/socket-patch-x86_64-apple-darwin.tar.gz -C pypi/socket-patch/socket_patch/bin/
274- mv pypi/socket-patch/socket_patch/bin/socket-patch pypi/socket-patch/socket_patch/bin/socket-patch-darwin-x64
275- tar xzf artifacts/socket-patch-x86_64-unknown-linux-musl.tar.gz -C pypi/socket-patch/socket_patch/bin/
276- mv pypi/socket-patch/socket_patch/bin/socket-patch pypi/socket-patch/socket_patch/bin/socket-patch-linux-x64
277- tar xzf artifacts/socket-patch-aarch64-unknown-linux-gnu.tar.gz -C pypi/socket-patch/socket_patch/bin/
278- mv pypi/socket-patch/socket_patch/bin/socket-patch pypi/socket-patch/socket_patch/bin/socket-patch-linux-arm64
279- cd pypi/socket-patch/socket_patch/bin
280- unzip ../../../../artifacts/socket-patch-x86_64-pc-windows-msvc.zip
281- mv socket-patch.exe socket-patch-win32-x64.exe
282-
283- - name : Set executable permissions
295+ - name : Build platform wheels
284296 run : |
285- chmod +x pypi/socket-patch/socket_patch/bin/socket-patch-darwin-arm64
286- chmod +x pypi/socket-patch/socket_patch/bin/socket-patch-darwin-x64
287- chmod +x pypi/socket-patch/socket_patch/bin/socket-patch-linux-x64
288- chmod +x pypi/socket-patch/socket_patch/bin/socket-patch-linux-arm64
289-
290- - name : Copy README for PyPI package
291- run : cp README.md pypi/socket-patch/README.md
292-
293- - name : Build package
294- run : python -m build pypi/socket-patch
297+ VERSION="${{ needs.sync-and-tag.outputs.version }}"
298+ python scripts/build-pypi-wheels.py --version "$VERSION" --artifacts artifacts --dist dist
295299
296300 - name : Publish to PyPI
297301 uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
298302 with :
299- packages-dir : pypi/socket-patch/ dist/
303+ packages-dir : dist/
0 commit comments