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