1
- name : build and publish
1
+ name : Build and publish pyModeS
2
2
3
3
on :
4
4
release :
5
- types :
6
- - published
5
+ types : [published]
7
6
workflow_dispatch :
8
7
8
+ env :
9
+ CIBW_BUILD : cp310* cp311* cp312* cp313*
10
+ CIBW_ARCHS_WINDOWS : auto64
11
+ CIBW_ARCHS_LINUX : auto64 aarch64
12
+ CIBW_ARCHS_MACOS : universal2
13
+ # CIBW_ARCHS_MACOS: auto universal2
14
+ CIBW_TEST_SKIP : " *universal2:arm64"
15
+
9
16
jobs :
10
- deploy :
11
- runs-on : ubuntu-latest
17
+ build_wheels :
18
+ name : Build wheels on ${{ matrix.os }}
19
+ runs-on : ${{ matrix.os }}
20
+ strategy :
21
+ matrix :
22
+ # macos-13 is an intel runner, macos-14 is apple silicon
23
+ os : [ubuntu-latest, windows-latest, macos-14]
24
+
12
25
steps :
13
26
- uses : actions/checkout@v4
14
27
15
- - name : Install uv
16
- uses : astral-sh/setup-uv@v3
28
+ - name : Set up QEMU
29
+ if : runner.os == 'Linux' && runner.arch == 'X64'
30
+ uses : docker/setup-qemu-action@v3
17
31
with :
18
- enable-cache : true
32
+ platforms : all
33
+
34
+ - name : Build wheels
35
+
36
+
37
+ - uses : actions/upload-artifact@v4
38
+ with :
39
+ name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
40
+ path : ./wheelhouse/*.whl
41
+
42
+ build_sdist :
43
+ name : Build source distribution
44
+ runs-on : ubuntu-latest
45
+ steps :
46
+ - uses : actions/checkout@v4
47
+
48
+ - name : Build sdist
49
+ run : pipx run build --sdist
19
50
20
- - name : Set up Python
21
- uses : actions/setup-python@v5
51
+ - uses : actions/upload-artifact@v4
22
52
with :
23
- python-version : " 3.11"
53
+ name : cibw-sdist
54
+ path : dist/*.tar.gz
24
55
25
- - name : Build packages
26
- run : |
27
- uvx --with cython --with setuptools hatchling build
56
+ upload_pypi :
57
+ needs : [build_wheels, build_sdist]
58
+ runs-on : ubuntu-latest
59
+ environment : pypi
60
+ permissions :
61
+ id-token : write
62
+ if : github.event_name == 'release' && github.event.action == 'published'
63
+ steps :
64
+ - uses : actions/download-artifact@v4
65
+ with :
66
+ # unpacks all CIBW artifacts into dist/
67
+ pattern : cibw-*
68
+ path : dist
69
+ merge-multiple : true
28
70
29
- - name : Publish a Python distribution to PyPI
30
- uses : pypa/gh-action-pypi-publish@release/v1
71
+ - uses : pypa/gh-action-pypi-publish@release/v1
31
72
with :
32
73
user : __token__
33
- password : ${{ secrets.PYPI_API_TOKEN_PYMODES }}
74
+ password : ${{ secrets.PYPI_API_TOKEN_PYMODES }}
0 commit comments