@@ -3,59 +3,143 @@ name: build_wheel_publish
33on :
44push :
55branches :[ master ]
6+ # tags:
7+ # - "v*"
68
79jobs :
8- build_wheels :
9- name :Build wheels on ${{ matrix.os }}
10- runs-on :${{ matrix.os }}
11- strategy :
12- matrix :
13- os :[ubuntu-latest, windows-latest, macos-latest]
10+ build_linux_x86 :
11+ name :Build Linux x86_64 wheels
12+ runs-on :ubuntu-latest
1413
1514steps :
1615 -uses :actions/checkout@v5
1716with :
1817submodules :recursive
1918
20- -name :Set up QEMU
21- if :runner.os == 'Linux'
22- uses :docker/setup-qemu-action@v2
19+ -name :Build wheels (Linux x86_64)
20+ uses :pypa/cibuildwheel@v3.3.0
21+ env :
22+ CIBW_BUILD_FRONTEND :" build"
23+ CIBW_MANYLINUX_X86_64_IMAGE :manylinux2014
24+ CIBW_ARCHS_LINUX :x86_64
25+
26+ -name :Upload wheels artifact
27+ uses :actions/upload-artifact@v4
28+ with :
29+ name :wheels-linux-x86_64
30+ path :wheelhouse/*.whl
31+
32+ build_linux_aarch64 :
33+ name :Build Linux aarch64 wheels
34+ runs-on :ubuntu-24.04-arm
35+
36+ steps :
37+ -uses :actions/checkout@v5
38+ with :
39+ submodules :recursive
40+
41+ -name :Build wheels (Linux aarch64)
42+ uses :pypa/cibuildwheel@v3.3.0
43+ env :
44+ CIBW_BUILD_FRONTEND :" build"
45+ CIBW_MANYLINUX_AARCH64_IMAGE :manylinux2014
46+ CIBW_ARCHS_LINUX :aarch64
47+
48+ -name :Upload wheels artifact
49+ uses :actions/upload-artifact@v4
50+ with :
51+ name :wheels-linux-aarch64
52+ path :wheelhouse/*.whl
53+
54+ build_windows :
55+ name :Build Windows wheels
56+ runs-on :windows-latest
57+
58+ steps :
59+ -uses :actions/checkout@v5
2360with :
24- platforms : all
61+ submodules : recursive
2562
2663 -name :Setup MSYS2 on Windows
27- if :startsWith(runner.os, 'Windows')
2864uses :msys2/setup-msys2@v2
2965with :
3066msystem :MINGW64
3167update :true
3268install :git unzip mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool make mingw-w64-x86_64-json-c mingw-w64-x86_64-crt-git
3369
3470 -name :Install NPCAP OEM on Windows
35- if : startsWith(runner.os, 'Windows')
71+ shell : pwsh
3672run :|
3773 choco install wget --no-progress
3874 wget --user ${{ secrets.NPCAP_OEM_USERNAME }} --password ${{ secrets.NPCAP_OEM_PASSWORD }} https://npcap.org/oem/dist/npcap-1.60-oem.exe
39- Start-Process npcap-1.60-oem.exe -ArgumentList "/loopback_support=yes /winpcap_mode=yes /dot11_support=yes /S" -wait
75+ Start-Process npcap-1.60-oem.exe -ArgumentList "/loopback_support=yes /winpcap_mode=yes /dot11_support=yes /S" -Wait
4076
41- -name :Build wheels
77+ -name :Build wheels (Windows)
4278uses :pypa/cibuildwheel@v3.3.0
4379env :
4480MSYSTEM :MINGW64
4581MSYS2_PATH :D:/a/_temp/msys64
4682CIBW_BUILD_FRONTEND :" build"
47- CIBW_MANYLINUX_X86_64_IMAGE :manylinux2014
48- CIBW_BEFORE_ALL_MACOS :brew install autoconf automake libtool pkg-config gettext json-c gcc
49- CIBW_ARCHS_LINUX :auto aarch64
5083CIBW_ARCHS_WINDOWS :auto64
84+
85+ -name :Upload wheels artifact
86+ uses :actions/upload-artifact@v4
87+ with :
88+ name :wheels-windows
89+ path :wheelhouse/*.whl
90+
91+ build_macos :
92+ name :Build macOS wheels
93+ runs-on :macos-latest
94+
95+ steps :
96+ -uses :actions/checkout@v5
97+ with :
98+ submodules :recursive
99+
100+ -name :Build wheels (macOS)
101+ uses :pypa/cibuildwheel@v3.3.0
102+ env :
103+ CIBW_BUILD_FRONTEND :" build"
104+ CIBW_BEFORE_ALL_MACOS :brew install autoconf automake libtool pkg-config gettext json-c gcc
51105CIBW_ARCHS_MACOS :x86_64 arm64
52106
53- -name :Publish on Pypi
54- # if: startsWith(github.ref, 'refs/tags/')
107+ -name :Upload wheels artifact
108+ uses :actions/upload-artifact@v4
109+ with :
110+ name :wheels-macos
111+ path :wheelhouse/*.whl
112+
113+ publish :
114+ name :Publish to PyPI
115+ runs-on :ubuntu-latest
116+ needs :
117+ -build_linux_x86
118+ -build_linux_aarch64
119+ -build_windows
120+ -build_macos
121+ # only publish on tag refs, e.g. refs/tags/v1.2.3
122+ # if: startsWith(github.ref, 'refs/tags/')
123+
124+ steps :
125+ -name :Download wheels artifacts
126+ uses :actions/download-artifact@v4
127+ with :
128+ path :dist
129+
130+ -name :Set up Python
131+ uses :actions/setup-python@v5
132+ with :
133+ python-version :" 3.11"
134+
135+ -name :Install Twine
136+ run :|
137+ python -m pip install --upgrade pip
138+ python -m pip install twine
139+
140+ -name :Publish on PyPI
55141env :
56142TWINE_USERNAME :__token__
57143TWINE_PASSWORD :${{ secrets.PYPI_TOKEN }}
58144run :|
59- python3 -m pip install --upgrade pip --break-system-packages
60- python3 -m pip install -r dev_requirements.txt --break-system-packages
61- python3 -m twine upload --skip-existing ./wheelhouse/nfstream-*.whl
145+ python -m twine upload --skip-existing dist/**/nfstream-*.whl