Debian Codegraph @

.github/workflows/release.yml

raw
1 name: Build and upload wheels
2 on:
3 workflow_dispatch:
4 schedule:
5 - cron: '0 0 * * 3'
6 push:
7 tags:
8 - '*'
9
10 jobs:
11 build_sdist:
12 name: Build sdist
13 runs-on: ubuntu-latest
14 steps:
15 - name: Checkout
16 uses: actions/checkout@v7
17 - name: Get history and tags for SCM versioning to work
18 run: |
19 git fetch --prune --unshallow
20 git fetch --depth=1 origin +refs/tags/*:refs/tags/*
21 - name: Setup Python
22 uses: actions/setup-python@v7
23 with:
24 python-version: '3.x'
25 - name: Build sdist
26 run: |
27 pip install --upgrade pip
28 pip install wheel build
29 python -m build . -s
30 - name: Test sdist
31 run: |
32 pip install pytest
33 pip install dist/*.tar.gz
34 cd ..
35 pytest kiwi/py/tests -v -W error
36 - name: Store artifacts
37 uses: actions/upload-artifact@v7
38 with:
39 name: cibw-sdist
40 path: dist/*
41
42 build_wheels:
43 name: Build wheels on ${{ matrix.os }} for ${{ matrix.archs }} using ${{ matrix.target }}+
44 runs-on: ${{ matrix.os }}
45 env:
46 BUILD_COMMIT: main
47 strategy:
48 fail-fast: false
49 matrix:
50 os: [ubuntu-latest, windows-latest, macos-latest]
51 target: [manylinux2010, manylinux2014]
52 archs: [auto]
53 include:
54 - os: ubuntu-latest
55 archs: aarch64
56 target: manylinux2010
57 - os: ubuntu-latest
58 archs: ppc64le
59 target: manylinux2010
60 - os: ubuntu-latest
61 archs: s390x
62 target: manylinux2010
63 - os: ubuntu-latest
64 archs: aarch64
65 target: manylinux2014
66 - os: ubuntu-latest
67 archs: ppc64le
68 target: manylinux2014
69 - os: ubuntu-latest
70 archs: riscv64
71 target: manylinux_2_39
72 - os: ubuntu-latest
73 archs: s390x
74 target: manylinux2014
75 - os: windows-latest
76 archs: ARM64
77 - os: ubuntu-latest
78 archs: auto
79 target: graalpy
80 - os: windows-latest
81 archs: auto64
82 target: graalpy
83 - os: macos-latest
84 archs: auto
85 target: graalpy
86 - os: macos-latest
87 archs: all
88 target: ios
89 steps:
90 - name: Checkout
91 uses: actions/checkout@v7
92 - name: Get history and tags for SCM versioning to work
93 run: |
94 git fetch --prune --unshallow
95 git fetch --depth=1 origin +refs/tags/*:refs/tags/*
96 - name: Setup Python
97 uses: actions/setup-python@v7
98 with:
99 python-version: '3.x'
100 - name: Set up QEMU
101 if: runner.os == 'Linux' && matrix.archs != 'auto'
102 uses: docker/setup-qemu-action@v4
103 with:
104 platforms: all
105 - name: Install cibuildwheel
106 run: |
107 python -m pip install --upgrade pip
108 python -m pip install wheel cibuildwheel==4.1.0
109 - name: Build wheels
110 if: matrix.target == 'manylinux2010'
111 env:
112 CIBW_BUILD: "cp310-*"
113 CIBW_ARCHS_MACOS: x86_64 universal2 arm64
114 CIBW_ARCHS_LINUX: ${{ matrix.archs }}
115 CIBW_ARCHS_WINDOWS: auto64
116 CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64
117 CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686
118 run: |
119 python -m cibuildwheel . --output-dir dist
120 - name: Build wheels
121 if: matrix.target == 'manylinux2014'
122 env:
123 CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-* cp314t-* cp315-* cp315t-* pp310-* pp311-*"
124 CIBW_SKIP: "cp313t-win*"
125 CIBW_ENABLE: pypy cpython-prerelease pypy-eol
126 CIBW_ARCHS_MACOS: x86_64 universal2 arm64
127 CIBW_ARCHS_LINUX: ${{ matrix.archs }}
128 CIBW_ARCHS_WINDOWS: auto64
129 CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
130 CIBW_MANYLINUX_I686_IMAGE: manylinux2014
131 run: |
132 python -m cibuildwheel . --output-dir dist
133 - name: Build wheels
134 if: matrix.target == 'manylinux_2_39'
135 env:
136 CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-* cp314t-* cp315-* cp315t-* pp310-* pp311-*"
137 CIBW_SKIP: "cp313t-win*"
138 CIBW_ENABLE: pypy cpython-prerelease pypy-eol
139 CIBW_ARCHS_LINUX: ${{ matrix.archs }}
140 run: |
141 python -m cibuildwheel . --output-dir dist
142 - name: Build wheels
143 if: runner.os == 'Windows' && matrix.archs == 'ARM64'
144 env:
145 CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp314t-* cp315-* cp315t-*"
146 CIBW_ENABLE: cpython-prerelease
147 CIBW_ARCHS_WINDOWS: ${{ matrix.archs }}
148 # It is not yet possible to run ARM64 tests, only cross-compile them.
149 CIBW_TEST_SKIP: "*-win_arm64"
150 run: |
151 python -m cibuildwheel . --output-dir dist
152 - name: Build wheels
153 if: matrix.target == 'graalpy'
154 env:
155 CIBW_BUILD: "gp312_250-*"
156 CIBW_ENABLE: graalpy
157 CIBW_ARCHS_MACOS: auto
158 CIBW_ARCHS_LINUX: auto
159 CIBW_ARCHS_WINDOWS: auto64
160 run: |
161 python -m cibuildwheel . --output-dir dist
162 - name: Build wheels
163 if: matrix.target == 'ios'
164 env:
165 CIBW_PLATFORM: ios
166 CIBW_ENABLE: cpython-prerelease
167 CIBW_ARCHS: all
168 run: |
169 python -m cibuildwheel . --output-dir dist
170 - name: Store artifacts
171 uses: actions/upload-artifact@v7
172 with:
173 name: cibw-wheels-${{ runner.os }}-${{ matrix.target }}-${{ matrix.archs }}
174 path: dist/*.whl
175
176 publish:
177 if: github.event_name == 'push'
178 needs: [build_wheels, build_sdist]
179 runs-on: ubuntu-latest
180 environment:
181 name: pypi
182 url: https://pypi.org/p/kiwisolver
183 permissions:
184 id-token: write
185 steps:
186 - uses: actions/[email protected]
187 with:
188 pattern: cibw-*
189 path: dist
190 merge-multiple: true
191
192 - uses: pypa/gh-action-pypi-publish@release/v1
193
194 github-release:
195 name: >-
196 Sign the Python 🐍 distribution 📦 with Sigstore
197 and create a GitHub Release
198 runs-on: ubuntu-latest
199 needs:
200 - publish
201
202 permissions:
203 contents: write
204 id-token: write
205
206 steps:
207 - name: Download all the dists
208 uses: actions/[email protected]
209 with:
210 pattern: cibw-*
211 path: dist
212 merge-multiple: true
213 - name: Sign the dists with Sigstore
214 uses: sigstore/[email protected]
215 with:
216 inputs: >-
217 ./dist/*.tar.gz
218 ./dist/*.whl
219 - name: Create GitHub Release
220 env:
221 GITHUB_TOKEN: ${{ github.token }}
222 run: >-
223 gh release create
224 '${{ github.ref_name }}'
225 --repo '${{ github.repository }}'
226 --generate-notes
227 - name: Upload artifact signatures to GitHub Release
228 env:
229 GITHUB_TOKEN: ${{ github.token }}
230 run: >-
231 gh release upload
232 '${{ github.ref_name }}' dist/**
233 --repo '${{ github.repository }}'