-
Notifications
You must be signed in to change notification settings - Fork 3
127 lines (102 loc) · 3.09 KB
/
python-packages.yml
File metadata and controls
127 lines (102 loc) · 3.09 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
name: "Build and Publish Python Packages"
on:
push:
tags:
- "v[0-9]+\\.[0-9]+\\.[0-9]+"
- "v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+"
jobs:
build_sdist:
name: "Source distribution"
runs-on: ubuntu-latest
steps:
- name: "Checkout the repository"
uses: actions/checkout@v6
with:
submodules: true
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install python dependencies"
run: |
pip install setuptools cffi
- name: "Build source distribution"
run: |
python setup.py sdist
- name: "Upload artifacts"
uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/
retention-days: 1
build_wheels:
name: "Build ${{ matrix.target.name }} wheels"
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target:
- name: "Linux Intel 32bits"
os: ubuntu-24.04
arch: i686
cibw_skip: cp314-* cp314t-* # CFFI has no more i686 support for Python >= 3.14
- name: "Linux Intel 64bits"
os: ubuntu-24.04
arch: x86_64
- name: "Linux ARM 64bits"
os: ubuntu-24.04
arch: aarch64
- name: "Linux ARMv7"
os: ubuntu-24.04
arch: armv7l
- name: "macOS Intel 64bits"
os: macos-13
arch: x86_64
- name: "macOS Apple Silicon (ARM 64bits)"
os: macos-14
arch: arm64
- name: "Windows Intel 64bit"
os: windows-2022
arch: AMD64
steps:
- name: "Checkout the repository"
uses: actions/checkout@v6
with:
submodules: true
- name: "Set up QEMU"
if: runner.os == 'Linux' && (matrix.target.arch == 'aarch64' || matrix.target.arch == 'armv7l')
uses: docker/setup-qemu-action@v4
- name: "Build wheels"
uses: pypa/cibuildwheel@v3.4.0
env:
CIBW_ARCHS: ${{ matrix.target.arch }}
CMAKE_OSX_ARCHITECTURES: ${{ matrix.target.arch }}
CIBW_SKIP: ${{ matrix.target.cibw_skip }}
PIP_USE_PEP517: 1
- name: "Upload artifacts"
uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.target.os }}-${{ matrix.target.arch }}
path: ./wheelhouse/*.whl
retention-days: 1
publish_pypi:
name: "Publish packages on PyPI"
runs-on: ubuntu-latest
needs:
- build_sdist
- build_wheels
steps:
- name: "Download artifacts"
uses: actions/download-artifact@v8
- name: "Move packages to the dist/ folder"
run: |
mkdir dist/
mv sdist/* dist/
mv wheels-*/*.whl dist/
- name: "List packages"
run: |
find . -name "*.whl" -o -name "*.tar.gz"
- name: "Publish packages on PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}