-
Notifications
You must be signed in to change notification settings - Fork 5
105 lines (92 loc) · 2.72 KB
/
python.yaml
File metadata and controls
105 lines (92 loc) · 2.72 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
name: Python
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
gen_api:
name: Generate public api
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Define spot.h
run: make api
- uses: actions/upload-artifact@v7
with:
name: api
path: dist/spot.h
if-no-files-found: error
build_wheels:
needs: gen_api
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: true
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
name: api
path: dist/
- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install some build dependencies
run: |
uv sync --all-extras
uv pip install abi3audit
working-directory: ./python
- name: Build wheel
run: uv run python -m build --wheel --installer uv
working-directory: ./python
- if: runner.os == 'Linux'
name: Repair wheel (linux)
run: uv run auditwheel repair -w wheel --strip dist/*.whl
working-directory: ./python
- if: runner.os == 'Linux'
name: Check abi3 (Linux)
run: uv run abi3audit --strict --report wheel/*.whl
working-directory: ./python
# check on windows if these two steps are ok
- if: runner.os == 'Windows'
name: Repair wheel (windows)
run: uv run delvewheel repair -w wheel --strip dist/$((dir dist|Select-Object -First 1).Name)
working-directory: ./python
- if: runner.os == 'Windows'
name: Check abi3 (Windows)
run: uv run abi3audit --strict --report dist/$((dir wheel|Select-Object -First 1).Name)
working-directory: ./python
- uses: actions/upload-artifact@v7
with:
path: ./python/wheel/*.whl
name: libspot-python-${{ matrix.os }}
upload:
name: Upload wheels to PyPI
needs:
- build_wheels
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
pattern: libspot-python-*
path: dist
merge-multiple: true
- name: debug
run: |
ls -alh --color=auto .
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.14.0