-
Notifications
You must be signed in to change notification settings - Fork 6
193 lines (172 loc) · 10.4 KB
/
Copy pathbuild.yml
File metadata and controls
193 lines (172 loc) · 10.4 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
name: Build
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- 'v*'
env:
VERSION: 0.5.0
jobs:
bindings:
strategy:
fail-fast: false
matrix:
variant:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
- {runner: macos-14-large, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.11' }
- {runner: macos-14-large, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.12' }
- {runner: macos-14-large, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.13' }
- {runner: macos-14-large, qt-os: mac, arch: x64, py-arch: x64, qt-compiler: clang_64, config: Release, py-version: '3.14' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-22.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-24.04, qt-os: linux, arch: x64, py-arch: x64, qt-compiler: gcc_64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: ubuntu-24.04-arm, qt-os: linux_arm64, arch: arm64, py-arch: arm64, qt-compiler: gcc_arm64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: ubuntu-24.04-arm, qt-os: linux_arm64, arch: arm64, py-arch: arm64, qt-compiler: gcc_arm64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-2022, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: windows-2025, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2025, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2025, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-2025, qt-os: windows, arch: x64, py-arch: x64, qt-compiler: msvc2019_64, config: RelWithDebInfo, py-version: '3.14' }
- {runner: windows-11-arm, qt-os: windows, arch: x64, py-arch: arm64, qt-compiler: msvc2019_arm64, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-11-arm, qt-os: windows, arch: x64, py-arch: arm64, qt-compiler: msvc2019_arm64, config: RelWithDebInfo, py-version: '3.14' }
runs-on: ${{ matrix.variant.runner }}
name: python${{ matrix.variant.py-version }} / ${{ matrix.variant.runner }} / ${{ matrix.variant.config }}
env:
CMAKE_FLAGS: ""
QT_VERSION: 6.7.3 # arm64 support in aqt appears from >= 6.7.0 - and almalinux ships an old libc incompat with >= 6.8.x
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.variant.py-version }}
architecture: ${{ matrix.variant.py-arch }}
- name: Environment Setup (Windows)
if: startsWith(matrix.variant.runner, 'windows-')
run: |
Import-Module .\.github\Invoke-VisualStudio.ps1
Invoke-VisualStudio2019${{ matrix.variant.arch }}
- name: Environment Setup (Linux)
if: startsWith(matrix.variant.runner, 'ubuntu-')
run: |
sudo apt-get -y update
sudo apt install -y g++ ninja-build clang
echo CC=clang >> $GITHUB_ENV
echo CXX=clang++ >> $GITHUB_ENV
- name: Environment Setup (macOS)
if: startsWith(matrix.variant.runner, 'macos-')
run: |
echo CC=clang >> $GITHUB_ENV
echo CXX=clang++ >> $GITHUB_ENV
- name: Cache Artifacts
id: cache-artifacts
uses: actions/cache@v5
with:
path: build/${{ env.QT_VERSION }}
key: aqt-install-${{ matrix.variant.runner }}-${{ matrix.variant.arch }}-${{ env.QT_VERSION }}-${{ matrix.variant.qt-compiler }}
- name: Setup Qt (Windows)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'windows-')
run: |
python -m pip install aqtinstall --user --upgrade
python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} win64_${{ matrix.variant.qt-compiler }}
- name: Setup Qt (Windows/ARM64)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && matrix.variant.qt-compiler == 'msvc2019_arm64'
run: |
python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} win64_msvc2019_64
- name: Setup Qt (macOS)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'macos-')
run: |
python -m pip install aqtinstall --user --upgrade
python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} ${{ matrix.variant.qt-compiler }}
- name: Setup Qt (Linux)
if: steps.cache-artifacts.outputs.cache-hit != 'true' && startsWith(matrix.variant.runner, 'ubuntu-')
run: |
python -m pip install aqtinstall --user --upgrade
python -m aqt install-qt -O build/ ${{ matrix.variant.qt-os }} desktop ${{ env.QT_VERSION }} linux_${{ matrix.variant.qt-compiler }}
- name: Python installation
run: |
python -m pip install '.[tests]' -U --user
- name: Test
if: startsWith(matrix.variant.runner, 'macos-') == false
run: |
python -m pytest -v python/tests
- name: Build wheels (Linux arm64)
if: matrix.variant.runner == 'ubuntu-24.04-arm' && matrix.variant.py-version == '3.14'
run: |
python -m pip uninstall --quiet --yes die-python
rm -fr -- build/cp*
python -m pip install cibuildwheel==2.23.0
python -m cibuildwheel --output-dir wheelhouse --archs aarch64
- name: Build wheels (Linux x64)
if: matrix.variant.runner == 'ubuntu-24.04' && matrix.variant.py-version == '3.14'
run: |
python -m pip uninstall --quiet --yes die-python
rm -fr -- build/cp*
python -m pip install cibuildwheel==2.23.0
python -m cibuildwheel --output-dir wheelhouse/ --archs x86_64
- name: Build wheels (Others)
if: startsWith(matrix.variant.runner, 'ubuntu-') == false
run: |
mkdir wheelhouse
python -m pip wheel . --wheel-dir wheel/ --progress-bar on
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: die-python-py${{ matrix.variant.py-version }}-${{ matrix.variant.runner }}.${{ matrix.variant.config }}
path: |
wheelhouse/die_python-*.whl
wheel/die_python-*.whl
retention-days: 1
publish:
needs: bindings
strategy:
fail-fast: false
matrix:
variant:
# https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
- {runner: macos-15-large, config: Release, py-version: '3.11' }
- {runner: macos-15-large, config: Release, py-version: '3.12' }
- {runner: macos-15-large, config: Release, py-version: '3.13' }
- {runner: macos-15-large, config: Release, py-version: '3.14' }
- {runner: ubuntu-24.04, config: RelWithDebInfo, py-version: '3.14' }
- {runner: ubuntu-24.04-arm, config: RelWithDebInfo, py-version: '3.14' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.11' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.12' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.13' }
- {runner: windows-2022, config: RelWithDebInfo, py-version: '3.14' }
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: PyPI upload of ${{ matrix.variant.runner }}/${{ matrix.variant.config }}/py${{ matrix.variant.py-version }}
environment:
name: pypi
url: https://pypi.org/p/die-python
permissions:
id-token: write
steps:
- name: Download Wheel ${{ matrix.variant.runner }}/${{ matrix.variant.py-version }}/${{ matrix.variant.config }}
uses: actions/download-artifact@v4
id: download_wheels
with:
name: die-python-py${{ matrix.variant.py-version }}-${{ matrix.variant.runner }}.${{ matrix.variant.config }}
path: .
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Publish package
run: |
mv */**/*.whl .
uv publish *.whl