-
Notifications
You must be signed in to change notification settings - Fork 43
256 lines (213 loc) · 7.61 KB
/
release.yml
File metadata and controls
256 lines (213 loc) · 7.61 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
jobs:
build-sdist:
name: Build sdist
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build frontend
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build sdist
run: python -m build --sdist
- name: Validate sdist
run: |
python .github/scripts/validate-dist.py dist/*.tar.gz
python -m twine check dist/*.tar.gz
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
build-linux-wheels:
name: Build Linux wheels
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel==2.23.3
- name: Build wheels
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: >-
bash /project/.github/scripts/build-sfml-unix.sh 3.0.2 /project/.deps/sfml-3.0.2-install 1
CIBW_ENVIRONMENT_LINUX: >-
SFML_HEADERS=/project/.deps/sfml-3.0.2-install/include
SFML_LIBRARIES=/project/.deps/sfml-3.0.2-install/lib
PKG_CONFIG_PATH=/project/.deps/sfml-3.0.2-install/lib/pkgconfig
LD_LIBRARY_PATH=/project/.deps/sfml-3.0.2-install/lib
CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel}
run: python -m cibuildwheel --output-dir wheelhouse
- name: Validate Linux wheels
run: |
python .github/scripts/validate-dist.py wheelhouse/*.whl
python -m pip install twine
python -m twine check wheelhouse/*.whl
- name: Upload Linux wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux
path: wheelhouse/*.whl
build-macos-wheels:
name: Build macOS wheels
runs-on: macos-15
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel==2.23.3
- name: Build wheels
env:
MACOSX_DEPLOYMENT_TARGET: "15.0"
CIBW_ARCHS_MACOS: arm64
CIBW_BEFORE_ALL_MACOS: >-
bash .github/scripts/build-sfml-unix.sh 3.0.2 ${{ github.workspace }}/.deps/sfml-3.0.2-install 1
CIBW_BEFORE_BUILD_MACOS: python -m pip install delocate
CIBW_ENVIRONMENT_MACOS: >-
MACOSX_DEPLOYMENT_TARGET=15.0
SFML_HEADERS=${{ github.workspace }}/.deps/sfml-3.0.2-install/include
SFML_LIBRARIES=${{ github.workspace }}/.deps/sfml-3.0.2-install/lib
DYLD_LIBRARY_PATH=${{ github.workspace }}/.deps/sfml-3.0.2-install/lib
PKG_CONFIG_PATH=${{ github.workspace }}/.deps/sfml-3.0.2-install/lib/pkgconfig
CIBW_REPAIR_WHEEL_COMMAND_MACOS: delocate-wheel --wheel-dir {dest_dir} {wheel}
run: python -m cibuildwheel --output-dir wheelhouse
- name: Validate macOS wheels
run: |
python .github/scripts/validate-dist.py wheelhouse/*.whl
python -m pip install twine
python -m twine check wheelhouse/*.whl
- name: Upload macOS wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos
path: wheelhouse/*.whl
build-windows-wheels:
name: Build Windows wheels
runs-on: windows-2022
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel==2.23.3
- name: Get CMake
id: get-cmake
uses: lukka/get-cmake@latest
- name: Build wheels
env:
CMAKE_EXE: ${{ steps.get-cmake.outputs.cmake-path }}
CIBW_ARCHS_WINDOWS: AMD64
CIBW_BEFORE_ALL_WINDOWS: >-
C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -NoProfile -ExecutionPolicy Bypass -File .github/scripts/build-sfml-windows.ps1 -Version 3.0.2 -Prefix C:/cibw-sfml-3.0.2 -Architecture x64
CIBW_BEFORE_BUILD_WINDOWS: python -m pip install delvewheel
CIBW_ENVIRONMENT_WINDOWS: >-
SFML_HEADERS='C:/cibw-sfml-3.0.2/include'
SFML_LIBRARIES='C:/cibw-sfml-3.0.2/lib'
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: python -m delvewheel repair --add-path C:/cibw-sfml-3.0.2/bin -w {dest_dir} {wheel}
run: python -m cibuildwheel --output-dir wheelhouse
- name: Validate Windows wheels
run: |
python .github/scripts/validate-dist.py wheelhouse/*.whl
python -m pip install twine
python -m twine check wheelhouse/*.whl
- name: Upload Windows wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows
path: wheelhouse/*.whl
verify-release-artifacts:
name: Verify release artifacts
needs:
- build-sdist
- build-linux-wheels
- build-macos-wheels
- build-windows-wheels
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Install validation tools
run: |
python -m pip install --upgrade pip
python -m pip install twine
- name: Validate all release artifacts
run: |
python .github/scripts/validate-dist.py dist/*
python -m twine check dist/*
publish-testpypi:
name: Publish to TestPyPI
needs:
- verify-release-artifacts
if: ${{ startsWith(github.ref, 'refs/tags/v') && (contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc')) }}
runs-on: ubuntu-24.04
permissions:
id-token: write
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish distributions
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
repository-url: https://test.pypi.org/legacy/
publish-pypi:
name: Publish to PyPI
needs:
- verify-release-artifacts
if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, 'a') && !contains(github.ref_name, 'b') && !contains(github.ref_name, 'rc') }}
runs-on: ubuntu-24.04
permissions:
id-token: write
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish distributions
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist