yamloom 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- yamloom-0.1.0/.github/workflows/release-please.yml +20 -0
- yamloom-0.1.0/.github/workflows/release.yml +333 -0
- yamloom-0.1.0/.gitignore +74 -0
- yamloom-0.1.0/.pre-commit-config.yaml +17 -0
- yamloom-0.1.0/.pre-commit-hooks.yaml +5 -0
- yamloom-0.1.0/.release-please-manifest.json +4 -0
- yamloom-0.1.0/.yamloom.py +235 -0
- yamloom-0.1.0/CHANGELOG.md +23 -0
- yamloom-0.1.0/Cargo.lock +262 -0
- yamloom-0.1.0/Cargo.toml +14 -0
- yamloom-0.1.0/Justfile +15 -0
- yamloom-0.1.0/PKG-INFO +7 -0
- yamloom-0.1.0/pyproject.toml +21 -0
- yamloom-0.1.0/python/yamloom/__init__.py +4 -0
- yamloom-0.1.0/python/yamloom/__init__.pyi +4 -0
- yamloom-0.1.0/python/yamloom/__main__.py +58 -0
- yamloom-0.1.0/python/yamloom/_yamloom.pyi +584 -0
- yamloom-0.1.0/python/yamloom/actions/__init__.py +0 -0
- yamloom-0.1.0/python/yamloom/actions/github/__init__.py +0 -0
- yamloom-0.1.0/python/yamloom/actions/github/artifacts.py +237 -0
- yamloom-0.1.0/python/yamloom/actions/github/cache.py +189 -0
- yamloom-0.1.0/python/yamloom/actions/github/release.py +97 -0
- yamloom-0.1.0/python/yamloom/actions/github/scm.py +102 -0
- yamloom-0.1.0/python/yamloom/actions/packaging/__init__.py +0 -0
- yamloom-0.1.0/python/yamloom/actions/packaging/python.py +84 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/__init__.py +0 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/dotnet.py +79 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/go.py +71 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/java.py +98 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/node.py +138 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/php.py +76 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/python.py +194 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/ruby.py +78 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/rust.py +153 -0
- yamloom-0.1.0/python/yamloom/actions/toolchains/system.py +72 -0
- yamloom-0.1.0/python/yamloom/actions/types.py +30 -0
- yamloom-0.1.0/python/yamloom/actions/utils.py +32 -0
- yamloom-0.1.0/python/yamloom/expressions.py +5 -0
- yamloom-0.1.0/python/yamloom/expressions.pyi +360 -0
- yamloom-0.1.0/python/yamloom/py.typed +0 -0
- yamloom-0.1.0/release-please-config.json +11 -0
- yamloom-0.1.0/src/lib.rs +4756 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Release Please
|
|
3
|
+
"on":
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
issues: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
jobs:
|
|
12
|
+
release-please:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Release Please Action
|
|
16
|
+
uses: googleapis/release-please-action@v4
|
|
17
|
+
with:
|
|
18
|
+
token: ${{ secrets.RELEASE_PLEASE }}
|
|
19
|
+
config-file: release-please-config.json
|
|
20
|
+
manifest-file: ".release-please-manifest.json"
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Build and Release
|
|
3
|
+
"on":
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- "*"
|
|
9
|
+
pull_request: ~
|
|
10
|
+
workflow_dispatch: ~
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
jobs:
|
|
14
|
+
linux:
|
|
15
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
platform:
|
|
19
|
+
- runner: ubuntu-22.04
|
|
20
|
+
target: x86_64
|
|
21
|
+
python_versions:
|
|
22
|
+
- "3.9"
|
|
23
|
+
- "3.10"
|
|
24
|
+
- "3.11"
|
|
25
|
+
- "3.12"
|
|
26
|
+
- "3.13"
|
|
27
|
+
- 3.13t
|
|
28
|
+
- "3.14"
|
|
29
|
+
- 3.14t
|
|
30
|
+
- pypy3.11
|
|
31
|
+
- runner: ubuntu-22.04
|
|
32
|
+
target: x86
|
|
33
|
+
python_versions:
|
|
34
|
+
- "3.9"
|
|
35
|
+
- "3.10"
|
|
36
|
+
- "3.11"
|
|
37
|
+
- "3.12"
|
|
38
|
+
- "3.13"
|
|
39
|
+
- 3.13t
|
|
40
|
+
- "3.14"
|
|
41
|
+
- 3.14t
|
|
42
|
+
- pypy3.11
|
|
43
|
+
- runner: ubuntu-22.04
|
|
44
|
+
target: aarch64
|
|
45
|
+
python_versions:
|
|
46
|
+
- "3.9"
|
|
47
|
+
- "3.10"
|
|
48
|
+
- "3.11"
|
|
49
|
+
- "3.12"
|
|
50
|
+
- "3.13"
|
|
51
|
+
- 3.13t
|
|
52
|
+
- "3.14"
|
|
53
|
+
- 3.14t
|
|
54
|
+
- pypy3.11
|
|
55
|
+
- runner: ubuntu-22.04
|
|
56
|
+
target: armv7
|
|
57
|
+
python_versions:
|
|
58
|
+
- "3.9"
|
|
59
|
+
- "3.10"
|
|
60
|
+
- "3.11"
|
|
61
|
+
- "3.12"
|
|
62
|
+
- "3.13"
|
|
63
|
+
- 3.13t
|
|
64
|
+
- "3.14"
|
|
65
|
+
- 3.14t
|
|
66
|
+
- pypy3.11
|
|
67
|
+
- runner: ubuntu-22.04
|
|
68
|
+
target: s390x
|
|
69
|
+
python_versions:
|
|
70
|
+
- "3.9"
|
|
71
|
+
- "3.10"
|
|
72
|
+
- "3.11"
|
|
73
|
+
- "3.12"
|
|
74
|
+
- "3.13"
|
|
75
|
+
- 3.13t
|
|
76
|
+
- "3.14"
|
|
77
|
+
- 3.14t
|
|
78
|
+
- pypy3.11
|
|
79
|
+
- runner: ubuntu-22.04
|
|
80
|
+
target: ppc64le
|
|
81
|
+
python_versions:
|
|
82
|
+
- "3.9"
|
|
83
|
+
- "3.10"
|
|
84
|
+
- "3.11"
|
|
85
|
+
- "3.12"
|
|
86
|
+
- "3.13"
|
|
87
|
+
- 3.13t
|
|
88
|
+
- "3.14"
|
|
89
|
+
- 3.14t
|
|
90
|
+
- pypy3.11
|
|
91
|
+
fail-fast: false
|
|
92
|
+
steps:
|
|
93
|
+
- name: Checkout Repository
|
|
94
|
+
uses: actions/checkout@v6
|
|
95
|
+
- name: Write version file
|
|
96
|
+
run: printf "%s\n" ${{ join(matrix.platform.python_versions, ' ') }} >> version.txt
|
|
97
|
+
- name: Setup Python
|
|
98
|
+
uses: actions/setup-python@v6
|
|
99
|
+
with:
|
|
100
|
+
python-version-file: version.txt
|
|
101
|
+
- name: Build wheels
|
|
102
|
+
uses: PyO3/maturin-action@v1
|
|
103
|
+
with:
|
|
104
|
+
manylinux: auto
|
|
105
|
+
target: ${{ matrix.platform.target }}
|
|
106
|
+
sccache: ${{ !(startsWith(github.ref, 'refs/tags/')) }}
|
|
107
|
+
args: --release --out dist --interpreter ${{ join(matrix.platform.python_versions, ' ') }}
|
|
108
|
+
- name: Upload Artifact
|
|
109
|
+
uses: actions/upload-artifact@v6
|
|
110
|
+
with:
|
|
111
|
+
path: dist
|
|
112
|
+
name: wheels-linux-${{ matrix.platform.target }}
|
|
113
|
+
musllinux:
|
|
114
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
115
|
+
strategy:
|
|
116
|
+
matrix:
|
|
117
|
+
platform:
|
|
118
|
+
- runner: ubuntu-22.04
|
|
119
|
+
target: x86_64
|
|
120
|
+
python_versions:
|
|
121
|
+
- "3.9"
|
|
122
|
+
- "3.10"
|
|
123
|
+
- "3.11"
|
|
124
|
+
- "3.12"
|
|
125
|
+
- "3.13"
|
|
126
|
+
- 3.13t
|
|
127
|
+
- "3.14"
|
|
128
|
+
- 3.14t
|
|
129
|
+
- pypy3.11
|
|
130
|
+
- runner: ubuntu-22.04
|
|
131
|
+
target: x86
|
|
132
|
+
python_versions:
|
|
133
|
+
- "3.9"
|
|
134
|
+
- "3.10"
|
|
135
|
+
- "3.11"
|
|
136
|
+
- "3.12"
|
|
137
|
+
- "3.13"
|
|
138
|
+
- 3.13t
|
|
139
|
+
- "3.14"
|
|
140
|
+
- 3.14t
|
|
141
|
+
- pypy3.11
|
|
142
|
+
- runner: ubuntu-22.04
|
|
143
|
+
target: aarch64
|
|
144
|
+
python_versions:
|
|
145
|
+
- "3.9"
|
|
146
|
+
- "3.10"
|
|
147
|
+
- "3.11"
|
|
148
|
+
- "3.12"
|
|
149
|
+
- "3.13"
|
|
150
|
+
- 3.13t
|
|
151
|
+
- "3.14"
|
|
152
|
+
- 3.14t
|
|
153
|
+
- pypy3.11
|
|
154
|
+
- runner: ubuntu-22.04
|
|
155
|
+
target: armv7
|
|
156
|
+
python_versions:
|
|
157
|
+
- "3.9"
|
|
158
|
+
- "3.10"
|
|
159
|
+
- "3.11"
|
|
160
|
+
- "3.12"
|
|
161
|
+
- "3.13"
|
|
162
|
+
- 3.13t
|
|
163
|
+
- "3.14"
|
|
164
|
+
- 3.14t
|
|
165
|
+
- pypy3.11
|
|
166
|
+
fail-fast: false
|
|
167
|
+
steps:
|
|
168
|
+
- name: Checkout Repository
|
|
169
|
+
uses: actions/checkout@v6
|
|
170
|
+
- name: Write version file
|
|
171
|
+
run: printf "%s\n" ${{ join(matrix.platform.python_versions, ' ') }} >> version.txt
|
|
172
|
+
- name: Setup Python
|
|
173
|
+
uses: actions/setup-python@v6
|
|
174
|
+
with:
|
|
175
|
+
python-version-file: version.txt
|
|
176
|
+
- name: Build wheels
|
|
177
|
+
uses: PyO3/maturin-action@v1
|
|
178
|
+
with:
|
|
179
|
+
manylinux: musllinux_1_2
|
|
180
|
+
target: ${{ matrix.platform.target }}
|
|
181
|
+
sccache: ${{ !(startsWith(github.ref, 'refs/tags/')) }}
|
|
182
|
+
args: --release --out dist --interpreter ${{ join(matrix.platform.python_versions, ' ') }}
|
|
183
|
+
- name: Upload Artifact
|
|
184
|
+
uses: actions/upload-artifact@v6
|
|
185
|
+
with:
|
|
186
|
+
path: dist
|
|
187
|
+
name: wheels-musllinux-${{ matrix.platform.target }}
|
|
188
|
+
windows:
|
|
189
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
190
|
+
strategy:
|
|
191
|
+
matrix:
|
|
192
|
+
platform:
|
|
193
|
+
- runner: windows-latest
|
|
194
|
+
target: x64
|
|
195
|
+
python_versions:
|
|
196
|
+
- "3.9"
|
|
197
|
+
- "3.10"
|
|
198
|
+
- "3.11"
|
|
199
|
+
- "3.12"
|
|
200
|
+
- "3.13"
|
|
201
|
+
- 3.13t
|
|
202
|
+
- "3.14"
|
|
203
|
+
- 3.14t
|
|
204
|
+
- pypy3.11
|
|
205
|
+
python_arch: x64
|
|
206
|
+
- runner: windows-latest
|
|
207
|
+
target: x86
|
|
208
|
+
python_versions:
|
|
209
|
+
- "3.9"
|
|
210
|
+
- "3.10"
|
|
211
|
+
- "3.11"
|
|
212
|
+
- "3.12"
|
|
213
|
+
- "3.13"
|
|
214
|
+
- 3.13t
|
|
215
|
+
- "3.14"
|
|
216
|
+
- 3.14t
|
|
217
|
+
python_arch: x86
|
|
218
|
+
- runner: windows-11-arm
|
|
219
|
+
target: aarch64
|
|
220
|
+
python_versions:
|
|
221
|
+
- "3.12"
|
|
222
|
+
- "3.13"
|
|
223
|
+
- "3.14"
|
|
224
|
+
python_arch: arm64
|
|
225
|
+
fail-fast: false
|
|
226
|
+
steps:
|
|
227
|
+
- name: Checkout Repository
|
|
228
|
+
uses: actions/checkout@v6
|
|
229
|
+
- name: Write version file
|
|
230
|
+
run: printf "%s\n" ${{ join(matrix.platform.python_versions, ' ') }} >> version.txt
|
|
231
|
+
- name: Setup Python
|
|
232
|
+
uses: actions/setup-python@v6
|
|
233
|
+
with:
|
|
234
|
+
python-version-file: version.txt
|
|
235
|
+
architecture: ${{ matrix.platform.python_arch }}
|
|
236
|
+
- name: Build wheels
|
|
237
|
+
uses: PyO3/maturin-action@v1
|
|
238
|
+
with:
|
|
239
|
+
target: ${{ matrix.platform.target }}
|
|
240
|
+
sccache: ${{ !(startsWith(github.ref, 'refs/tags/')) }}
|
|
241
|
+
args: --release --out dist --interpreter ${{ join(matrix.platform.python_versions, ' ') }}
|
|
242
|
+
- name: Upload Artifact
|
|
243
|
+
uses: actions/upload-artifact@v6
|
|
244
|
+
with:
|
|
245
|
+
path: dist
|
|
246
|
+
name: wheels-windows-${{ matrix.platform.target }}
|
|
247
|
+
macos:
|
|
248
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
249
|
+
strategy:
|
|
250
|
+
matrix:
|
|
251
|
+
platform:
|
|
252
|
+
- runner: macos-15-intel
|
|
253
|
+
target: x86_64
|
|
254
|
+
python_versions:
|
|
255
|
+
- "3.9"
|
|
256
|
+
- "3.10"
|
|
257
|
+
- "3.11"
|
|
258
|
+
- "3.12"
|
|
259
|
+
- "3.13"
|
|
260
|
+
- 3.13t
|
|
261
|
+
- "3.14"
|
|
262
|
+
- 3.14t
|
|
263
|
+
- pypy3.11
|
|
264
|
+
- runner: macos-latest
|
|
265
|
+
target: aarch64
|
|
266
|
+
python_versions:
|
|
267
|
+
- "3.9"
|
|
268
|
+
- "3.10"
|
|
269
|
+
- "3.11"
|
|
270
|
+
- "3.12"
|
|
271
|
+
- "3.13"
|
|
272
|
+
- 3.13t
|
|
273
|
+
- "3.14"
|
|
274
|
+
- 3.14t
|
|
275
|
+
- pypy3.11
|
|
276
|
+
fail-fast: false
|
|
277
|
+
steps:
|
|
278
|
+
- name: Checkout Repository
|
|
279
|
+
uses: actions/checkout@v6
|
|
280
|
+
- name: Write version file
|
|
281
|
+
run: printf "%s\n" ${{ join(matrix.platform.python_versions, ' ') }} >> version.txt
|
|
282
|
+
- name: Setup Python
|
|
283
|
+
uses: actions/setup-python@v6
|
|
284
|
+
with:
|
|
285
|
+
python-version-file: version.txt
|
|
286
|
+
- name: Build wheels
|
|
287
|
+
uses: PyO3/maturin-action@v1
|
|
288
|
+
with:
|
|
289
|
+
target: ${{ matrix.platform.target }}
|
|
290
|
+
sccache: ${{ !(startsWith(github.ref, 'refs/tags/')) }}
|
|
291
|
+
args: --release --out dist --interpreter ${{ join(matrix.platform.python_versions, ' ') }}
|
|
292
|
+
- name: Upload Artifact
|
|
293
|
+
uses: actions/upload-artifact@v6
|
|
294
|
+
with:
|
|
295
|
+
path: dist
|
|
296
|
+
name: wheels-macos-${{ matrix.platform.target }}
|
|
297
|
+
sdist:
|
|
298
|
+
name: Build Source Distribution
|
|
299
|
+
runs-on: ubuntu-22.04
|
|
300
|
+
steps:
|
|
301
|
+
- name: Checkout Repository
|
|
302
|
+
uses: actions/checkout@v6
|
|
303
|
+
- name: Build sdist
|
|
304
|
+
uses: PyO3/maturin-action@v1
|
|
305
|
+
with:
|
|
306
|
+
command: sdist
|
|
307
|
+
args: "--out dist"
|
|
308
|
+
- name: Upload Artifact
|
|
309
|
+
uses: actions/upload-artifact@v6
|
|
310
|
+
with:
|
|
311
|
+
path: dist
|
|
312
|
+
name: wheels-sdist
|
|
313
|
+
release:
|
|
314
|
+
name: Release
|
|
315
|
+
permissions:
|
|
316
|
+
contents: write
|
|
317
|
+
id-token: write
|
|
318
|
+
needs:
|
|
319
|
+
- linux
|
|
320
|
+
- musllinux
|
|
321
|
+
- windows
|
|
322
|
+
- macos
|
|
323
|
+
- sdist
|
|
324
|
+
if: ${{ (startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch')) }}
|
|
325
|
+
runs-on: ubuntu-22.04
|
|
326
|
+
environment: pypi
|
|
327
|
+
steps:
|
|
328
|
+
- name: Download Artifact
|
|
329
|
+
uses: actions/download-artifact@v7
|
|
330
|
+
- name: Setup uv
|
|
331
|
+
uses: astral-sh/setup-uv@v7
|
|
332
|
+
- name: Publish to PyPI
|
|
333
|
+
run: uv publish --trusted-publishing always wheels-*/*
|
yamloom-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/target
|
|
2
|
+
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
.venv/
|
|
14
|
+
env/
|
|
15
|
+
bin/
|
|
16
|
+
build/
|
|
17
|
+
develop-eggs/
|
|
18
|
+
dist/
|
|
19
|
+
eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
include/
|
|
26
|
+
man/
|
|
27
|
+
venv/
|
|
28
|
+
*.egg-info/
|
|
29
|
+
.installed.cfg
|
|
30
|
+
*.egg
|
|
31
|
+
|
|
32
|
+
# Installer logs
|
|
33
|
+
pip-log.txt
|
|
34
|
+
pip-delete-this-directory.txt
|
|
35
|
+
pip-selfcheck.json
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.coverage
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
|
|
45
|
+
# Translations
|
|
46
|
+
*.mo
|
|
47
|
+
|
|
48
|
+
# Mr Developer
|
|
49
|
+
.mr.developer.cfg
|
|
50
|
+
.project
|
|
51
|
+
.pydevproject
|
|
52
|
+
|
|
53
|
+
# Rope
|
|
54
|
+
.ropeproject
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
.DS_Store
|
|
61
|
+
|
|
62
|
+
# Sphinx documentation
|
|
63
|
+
docs/_build/
|
|
64
|
+
|
|
65
|
+
# PyCharm
|
|
66
|
+
.idea/
|
|
67
|
+
|
|
68
|
+
# VSCode
|
|
69
|
+
.vscode/
|
|
70
|
+
|
|
71
|
+
# Pyenv
|
|
72
|
+
.python-version
|
|
73
|
+
|
|
74
|
+
/local_tests
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
# Ruff version.
|
|
4
|
+
rev: v0.14.13
|
|
5
|
+
hooks:
|
|
6
|
+
# Run the linter.
|
|
7
|
+
- id: ruff-check
|
|
8
|
+
args: [ --fix ]
|
|
9
|
+
# Run the formatter.
|
|
10
|
+
- id: ruff-format
|
|
11
|
+
- repo: https://github.com/NSPBot911/ty-pre-commit
|
|
12
|
+
# ty version.
|
|
13
|
+
rev: v0.0.12
|
|
14
|
+
hooks:
|
|
15
|
+
# Run the linter.
|
|
16
|
+
- id: ty-check
|
|
17
|
+
types_or: [ python, pyi ]
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from yamloom.actions.github.artifacts import upload_artifact, download_artifact
|
|
3
|
+
from yamloom.actions.packaging.python import maturin
|
|
4
|
+
from yamloom.actions.toolchains.python import setup_python, setup_uv
|
|
5
|
+
from yamloom.actions.github.scm import checkout
|
|
6
|
+
from yamloom.expressions import context
|
|
7
|
+
from yamloom import (
|
|
8
|
+
Workflow,
|
|
9
|
+
Events,
|
|
10
|
+
PushEvent,
|
|
11
|
+
PullRequestEvent,
|
|
12
|
+
WorkflowDispatchEvent,
|
|
13
|
+
Permissions,
|
|
14
|
+
Job,
|
|
15
|
+
Matrix,
|
|
16
|
+
Strategy,
|
|
17
|
+
script,
|
|
18
|
+
Environment,
|
|
19
|
+
action,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class Target:
|
|
25
|
+
runner: str
|
|
26
|
+
target: str
|
|
27
|
+
skip_python_versions: list[str] | None = None
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DEFAULT_PYTHON_VERSIONS = [
|
|
31
|
+
'3.9',
|
|
32
|
+
'3.10',
|
|
33
|
+
'3.11',
|
|
34
|
+
'3.12',
|
|
35
|
+
'3.13',
|
|
36
|
+
'3.13t',
|
|
37
|
+
'3.14',
|
|
38
|
+
'3.14t',
|
|
39
|
+
'pypy3.11',
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def resolve_python_versions(skip: list[str] | None) -> list[str]:
|
|
44
|
+
if not skip:
|
|
45
|
+
return DEFAULT_PYTHON_VERSIONS
|
|
46
|
+
skipped = set(skip)
|
|
47
|
+
return [version for version in DEFAULT_PYTHON_VERSIONS if version not in skipped]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def create_build_job(job_name: str, name: str, targets: list[Target]) -> Job:
|
|
51
|
+
def platform_entry(target: Target) -> dict[str, object]:
|
|
52
|
+
entry = {
|
|
53
|
+
'runner': target.runner,
|
|
54
|
+
'target': target.target,
|
|
55
|
+
'python_versions': resolve_python_versions(target.skip_python_versions),
|
|
56
|
+
}
|
|
57
|
+
python_arch = (
|
|
58
|
+
('arm64' if target.target == 'aarch64' else target.target)
|
|
59
|
+
if name == 'windows'
|
|
60
|
+
else None
|
|
61
|
+
)
|
|
62
|
+
if python_arch is not None:
|
|
63
|
+
entry['python_arch'] = python_arch
|
|
64
|
+
return entry
|
|
65
|
+
|
|
66
|
+
return Job(
|
|
67
|
+
[
|
|
68
|
+
checkout(),
|
|
69
|
+
script(
|
|
70
|
+
'Write version file',
|
|
71
|
+
f'printf "%s\n" {context.matrix.platform.python_versions.as_array().join(" ")} >> version.txt',
|
|
72
|
+
),
|
|
73
|
+
setup_python(
|
|
74
|
+
python_version_file='version.txt',
|
|
75
|
+
architecture=context.matrix.platform.python_arch.as_str()
|
|
76
|
+
if name == 'windows'
|
|
77
|
+
else None,
|
|
78
|
+
),
|
|
79
|
+
maturin(
|
|
80
|
+
name='Build wheels',
|
|
81
|
+
target=context.matrix.platform.target.as_str(),
|
|
82
|
+
args=f'--release --out dist --interpreter {context.matrix.platform.python_versions.as_array().join(" ")}',
|
|
83
|
+
sccache=~context.github.ref.startswith('refs/tags/'),
|
|
84
|
+
manylinux='musllinux_1_2'
|
|
85
|
+
if name == 'musllinux'
|
|
86
|
+
else ('auto' if name == 'linux' else None),
|
|
87
|
+
),
|
|
88
|
+
upload_artifact(
|
|
89
|
+
path='dist',
|
|
90
|
+
artifact_name=f'wheels-{name}-{context.matrix.platform.target}',
|
|
91
|
+
),
|
|
92
|
+
],
|
|
93
|
+
runs_on=context.matrix.platform.runner.as_str(),
|
|
94
|
+
strategy=Strategy(
|
|
95
|
+
fast_fail=False,
|
|
96
|
+
matrix=Matrix(
|
|
97
|
+
platform=[platform_entry(target) for target in targets],
|
|
98
|
+
),
|
|
99
|
+
),
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
release_workflow = Workflow(
|
|
104
|
+
name='Build and Release',
|
|
105
|
+
on=Events(
|
|
106
|
+
push=PushEvent(branches=['main'], tags=['*']),
|
|
107
|
+
pull_request=PullRequestEvent(),
|
|
108
|
+
workflow_dispatch=WorkflowDispatchEvent(),
|
|
109
|
+
),
|
|
110
|
+
permissions=Permissions(contents='read'),
|
|
111
|
+
jobs={
|
|
112
|
+
'linux': create_build_job(
|
|
113
|
+
'Build Linux Wheels',
|
|
114
|
+
'linux',
|
|
115
|
+
[
|
|
116
|
+
Target(
|
|
117
|
+
'ubuntu-22.04',
|
|
118
|
+
target,
|
|
119
|
+
)
|
|
120
|
+
for target in [
|
|
121
|
+
'x86_64',
|
|
122
|
+
'x86',
|
|
123
|
+
'aarch64',
|
|
124
|
+
'armv7',
|
|
125
|
+
's390x',
|
|
126
|
+
'ppc64le',
|
|
127
|
+
]
|
|
128
|
+
],
|
|
129
|
+
),
|
|
130
|
+
'musllinux': create_build_job(
|
|
131
|
+
'Build (musl) Linux Wheels',
|
|
132
|
+
'musllinux',
|
|
133
|
+
[
|
|
134
|
+
Target(
|
|
135
|
+
'ubuntu-22.04',
|
|
136
|
+
target,
|
|
137
|
+
)
|
|
138
|
+
for target in [
|
|
139
|
+
'x86_64',
|
|
140
|
+
'x86',
|
|
141
|
+
'aarch64',
|
|
142
|
+
'armv7',
|
|
143
|
+
]
|
|
144
|
+
],
|
|
145
|
+
),
|
|
146
|
+
'windows': create_build_job(
|
|
147
|
+
'Build Windows Wheels',
|
|
148
|
+
'windows',
|
|
149
|
+
[
|
|
150
|
+
Target(
|
|
151
|
+
'windows-latest',
|
|
152
|
+
'x64',
|
|
153
|
+
),
|
|
154
|
+
Target('windows-latest', 'x86', ['pypy3.11']),
|
|
155
|
+
Target(
|
|
156
|
+
'windows-11-arm',
|
|
157
|
+
'aarch64',
|
|
158
|
+
['3.9', '3.10', '3.11', '3.13t', '3.14t', 'pypy3.11'],
|
|
159
|
+
),
|
|
160
|
+
],
|
|
161
|
+
),
|
|
162
|
+
'macos': create_build_job(
|
|
163
|
+
'Build macOS Wheels',
|
|
164
|
+
'macos',
|
|
165
|
+
[
|
|
166
|
+
Target(
|
|
167
|
+
'macos-15-intel',
|
|
168
|
+
'x86_64',
|
|
169
|
+
),
|
|
170
|
+
Target(
|
|
171
|
+
'macos-latest',
|
|
172
|
+
'aarch64',
|
|
173
|
+
),
|
|
174
|
+
],
|
|
175
|
+
),
|
|
176
|
+
'sdist': Job(
|
|
177
|
+
[
|
|
178
|
+
checkout(),
|
|
179
|
+
maturin(name='Build sdist', command='sdist', args='--out dist'),
|
|
180
|
+
upload_artifact(path='dist', artifact_name='wheels-sdist'),
|
|
181
|
+
],
|
|
182
|
+
name='Build Source Distribution',
|
|
183
|
+
runs_on='ubuntu-22.04',
|
|
184
|
+
),
|
|
185
|
+
'release': Job(
|
|
186
|
+
[
|
|
187
|
+
download_artifact(),
|
|
188
|
+
setup_uv(),
|
|
189
|
+
script(
|
|
190
|
+
'Publish to PyPI',
|
|
191
|
+
'uv publish --trusted-publishing always wheels-*/*',
|
|
192
|
+
),
|
|
193
|
+
],
|
|
194
|
+
name='Release',
|
|
195
|
+
runs_on='ubuntu-22.04',
|
|
196
|
+
condition=context.github.ref.startswith('refs/tags/')
|
|
197
|
+
| (context.github.event_name == 'workflow_dispatch'),
|
|
198
|
+
needs=['linux', 'musllinux', 'windows', 'macos', 'sdist'],
|
|
199
|
+
permissions=Permissions(id_token='write', contents='write'),
|
|
200
|
+
environment=Environment('pypi'),
|
|
201
|
+
),
|
|
202
|
+
},
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
version_workflow = Workflow(
|
|
206
|
+
name='Release Please',
|
|
207
|
+
on=Events(
|
|
208
|
+
push=PushEvent(
|
|
209
|
+
branches=['main'],
|
|
210
|
+
),
|
|
211
|
+
),
|
|
212
|
+
permissions=Permissions(contents='write', issues='write', pull_requests='write'),
|
|
213
|
+
jobs={
|
|
214
|
+
'release-please': Job(
|
|
215
|
+
[
|
|
216
|
+
action(
|
|
217
|
+
'Release Please Action',
|
|
218
|
+
'googleapis/release-please-action',
|
|
219
|
+
ref='v4',
|
|
220
|
+
with_opts={
|
|
221
|
+
'token': context.secrets.RELEASE_PLEASE,
|
|
222
|
+
'config-file': 'release-please-config.json',
|
|
223
|
+
'manifest-file': '.release-please-manifest.json',
|
|
224
|
+
},
|
|
225
|
+
)
|
|
226
|
+
],
|
|
227
|
+
runs_on='ubuntu-latest',
|
|
228
|
+
)
|
|
229
|
+
},
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
if __name__ == '__main__':
|
|
234
|
+
release_workflow.dump('.github/workflows/release.yml')
|
|
235
|
+
version_workflow.dump('.github/workflows/release-please.yml')
|