-
Notifications
You must be signed in to change notification settings - Fork 14
63 lines (59 loc) · 1.58 KB
/
build-python.yml
File metadata and controls
63 lines (59 loc) · 1.58 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
name: build-python
on:
pull_request:
push:
branches:
- master
tags:
- "flimlib-[0-9]+.*"
jobs:
wheels:
name: wheels-${{ matrix.runner }}
strategy:
matrix:
runner:
- ubuntu-24.04
- windows-2025
- macos-15
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v3.2.0
env:
# For macOS, select all here and constrain in pyproject.toml
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
# Do not warn about the x86_64 portion of universal2 not being tested
CIBW_TEST_SKIP: "*-macosx_universal2:x86_64"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.runner }}-wheels
path: wheelhouse/*.whl
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Do not pass --sdist to 'build' so that building from the sdist is
# tested (at least on Ubuntu)
- run: pipx run build
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
pypi-upload:
needs:
- wheels
- sdist
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- run: ls dist # For the log.
- uses: pypa/gh-action-pypi-publish@v1.13.0
if: >-
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/flimlib-')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}