forked from tuxu/python-samplerate
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (72 loc) · 2.31 KB
/
pythonpackage.yml
File metadata and controls
76 lines (72 loc) · 2.31 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
name: samplerate
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 12
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
# - name: Checkout submodules
# shell: bash
# run: |
# auth_header="$(git config --local --get http.https://github.com/.extraheader)"
# git submodule sync --recursive
# git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Sync dependencies with uv
run: |
uv sync --locked --all-groups --python ${{ matrix.python-version }}
- name: Build sdist
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
run: |
uv build --sdist
- name: Upload sdist
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
uses: actions/upload-artifact@v5
with:
name: dist-python-samplerate-ledfx
path: dist/*.tar.gz
if-no-files-found: error
- name: Build wheel for ${{ matrix.os }} Python ${{ matrix.python-version }}
run: |
uv build --wheel
- name: Test with pytest
run: |
uv run pytest
- name: Upload wheel
uses: actions/upload-artifact@v5
with:
name: dist-python-samplerate-ledfx-${{ matrix.os }}-py${{ matrix.python-version }}
path: dist/*.whl
if-no-files-found: error
publish:
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/python-samplerate-ledfx/
permissions:
id-token: write # Required for trusted publishing
steps:
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Download all artifacts
uses: actions/download-artifact@v5
with:
path: dist
pattern: dist-*
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R dist
- name: Publish to PyPI
run: |
uv publish --trusted-publishing always