1+ name : Build & Publish wheels
2+ on :
3+ workflow_dispatch
4+
5+
6+ jobs :
7+ build_wheels_win :
8+ name : Build wheels on Windows
9+ runs-on : windows-latest
10+
11+ steps :
12+ - uses : actions/checkout@v4
13+ with :
14+ submodules : recursive
15+
16+ - name : Setup .NET
17+ uses : actions/setup-dotnet@v4
18+ with :
19+ dotnet-version : 9.X
20+
21+ - name : Publish
22+ run : |
23+ dotnet publish -c Release -r win-x86
24+ dotnet publish -c Release -r win-x64
25+ dotnet publish -c Release -r win-arm64
26+
27+ - name : Set up Python
28+ uses : actions/setup-python@v5
29+ with :
30+ python-version : ' 3.x'
31+
32+ - name : Build Wheels
33+ run : |
34+ cd ./bindings/python
35+ python -m pip install setuptools
36+ python setup.py bdist_wheel -p win32
37+ python setup.py bdist_wheel -p win_amd64
38+ python setup.py bdist_wheel -p win_arm64
39+
40+ - uses : actions/upload-artifact@v4
41+ with :
42+ name : Windows
43+ path : ./bindings/python/dist/*.whl
44+ retention-days : 1
45+
46+ build_wheels_mac :
47+ name : Build wheels on MacOS
48+ runs-on : macos-latest
49+
50+ steps :
51+ - uses : actions/checkout@v4
52+ with :
53+ submodules : recursive
54+
55+ - name : Setup .NET
56+ uses : actions/setup-dotnet@v4
57+ with :
58+ dotnet-version : 9.X
59+
60+ - name : Publish
61+ run : |
62+ dotnet publish -c Release -r osx-x64
63+ dotnet publish -c Release -r osx-arm64
64+
65+ - name : Set up Python
66+ uses : actions/setup-python@v5
67+ with :
68+ python-version : ' 3.x'
69+
70+ - name : Build Wheels
71+ run : |
72+ cd ./bindings/python
73+ python -m pip install setuptools
74+ python setup.py bdist_wheel -p macosx_10_0_x86_64
75+ python setup.py bdist_wheel -p macosx_10_0_arm64
76+
77+ - uses : actions/upload-artifact@v4
78+ with :
79+ name : MacOS
80+ path : ./bindings/python/dist/*.whl
81+ retention-days : 1
82+
83+ build_wheels_linux :
84+ name : Build wheels on Ubuntu
85+ runs-on : ubuntu-22.04 # oldest ubuntu for compatiblity
86+
87+ steps :
88+ - uses : actions/checkout@v4
89+ with :
90+ submodules : recursive
91+
92+ - name : Setup .NET
93+ uses : actions/setup-dotnet@v4
94+ with :
95+ dotnet-version : 9.X
96+
97+ - name : Publish
98+ run : |
99+ dotnet publish -c Release -r linux-x64
100+ dotnet publish -c Release -r linux-musl-x64
101+
102+ - name : Set up Python
103+ uses : actions/setup-python@v5
104+ with :
105+ python-version : ' 3.x'
106+
107+ - name : Build Wheels
108+ run : |
109+ cd ./bindings/python
110+ python -m pip install setuptools
111+ python setup.py bdist_wheel -p manylinux2014_x86_64
112+ python setup.py bdist_wheel -p musllinux_2_0_x86_64
113+
114+ - uses : actions/upload-artifact@v4
115+ with :
116+ name : Linux
117+ path : ./bindings/python/dist/*.whl
118+ retention-days : 1
119+
120+ build_wheels_linux_arm :
121+ name : Build wheels on Ubuntu-Arm
122+ runs-on : ubuntu-22.04-arm # oldest ubuntu for compatiblity
123+
124+ steps :
125+ - uses : actions/checkout@v4
126+ with :
127+ submodules : recursive
128+
129+ - name : Setup .NET
130+ uses : actions/setup-dotnet@v4
131+ with :
132+ dotnet-version : 9.X
133+
134+ - name : Publish Arm64
135+ run : |
136+ dotnet publish -c Release -r linux-arm64
137+ dotnet publish -c Release -r linux-musl-arm64
138+
139+ - name : Publish Arm
140+ run : |
141+ sudo dpkg --add-architecture armhf
142+ sudo apt update
143+ sudo apt install -y gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf libc6-dev:armhf
144+ dotnet publish -c Release -r linux-arm
145+
146+ - name : Set up Python
147+ uses : actions/setup-python@v5
148+ with :
149+ python-version : ' 3.x'
150+
151+ - name : Build Wheels
152+ run : |
153+ cd ./bindings/python
154+ python -m pip install setuptools
155+ python setup.py bdist_wheel -p manylinux2014_aarch64
156+ python setup.py bdist_wheel -p manylinux2014_armv7l
157+ python setup.py bdist_wheel -p musllinux_2_0_aarch64
158+
159+ - uses : actions/upload-artifact@v4
160+ with :
161+ name : Linux-Arm
162+ path : ./bindings/python/dist/*.whl
163+ retention-days : 1
164+
165+ upload_pypi :
166+ name : Publish to PyPI
167+ needs : [build_wheels_win, build_wheels_mac, build_wheels_linux, build_wheels_linux_arm]
168+ runs-on : ubuntu-latest
169+
170+ permissions :
171+ id-token : write
172+ steps :
173+ - uses : actions/download-artifact@v4
174+ with :
175+ path : dist
176+ merge-multiple : true
177+
178+ - name : Publish package distributions to PyPI
179+ uses : pypa/gh-action-pypi-publish@release/v1
180+ with :
181+ skip-existing : true
0 commit comments