@@ -4,7 +4,6 @@ on: [push, pull_request]
44
55jobs :
66 build :
7-
87 runs-on : ${{ matrix.os }}
98 strategy :
109 fail-fast : false
@@ -13,66 +12,65 @@ jobs:
1312 os : [ubuntu-latest, macos-latest, windows-latest]
1413 python-version : [3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
1514 steps :
16- - uses : actions/checkout@v3
17- - name : Checkout submodules
18- shell : bash
19- run : |
20- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
21- git submodule sync --recursive
22- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
23- - name : Set up Python ${{ matrix.python-version }}
24- uses : actions/setup-python@v4
15+ - uses : actions/checkout@v5
2516 with :
26- python-version : ${{ matrix.python-version }}
27- - name : Install dependencies
28- run : |
29- python -m pip install --upgrade pip
30- pip install -U setuptools setuptools_scm wheel build twine
31- pip install -r requirements.txt
32- - name : Build package
33- run : |
34- python -m pip install -e .
35- - name : Test with pytest
36- run : |
37- pytest
38- - name : Test the universal wheels
39- if : matrix.os == 'ubuntu-latest'
40- run : |
41- # do not build binary wheels on linux
42- python -m build --sdist
43- twine check dist/*
44- - name : Test the binary wheels
45- if : matrix.os != 'ubuntu-latest'
17+ submodules : recursive
18+ # - name: Checkout submodules
19+ # shell: bash
20+ # run: |
21+ # auth_header="$(git config --local --get http.https://github.com/.extraheader)"
22+ # git submodule sync --recursive
23+ # git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
24+ - name : Install uv
25+ uses : astral-sh/setup-uv@v7
26+ - name : Sync dependencies with uv
4627 run : |
47- python -m build
48- twine check dist/*
49- - name : Publish sdist to pypi
50- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && matrix.os == 'ubuntu-latest'
51- env :
52- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
53- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
28+ uv sync --locked --all-groups --python ${{ matrix.python-version }}
29+ - name : Build sdist
30+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
5431 run : |
55- twine upload --skip-existing dist/*
56- - name : Publish bdist to pypi
57- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && matrix.os != 'ubuntu-latest'
58- env :
59- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
60- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
32+ uv build --sdist
33+ - name : Upload sdist
34+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
35+ uses : actions/upload-artifact@v5
36+ with :
37+ name : dist-python-samplerate-ledfx
38+ path : dist/*.tar.gz
39+ if-no-files-found : error
40+ - name : Build wheel for ${{ matrix.os }} Python ${{ matrix.python-version }}
6141 run : |
62- twine upload --skip-existing dist/*
63- - name : Publish sdist to pypi-test
64- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/test-') && matrix.os == 'ubuntu-latest'
65- env :
66- TWINE_USERNAME : ${{ secrets.PYPITEST_USERNAME }}
67- TWINE_PASSWORD : ${{ secrets.PYPITEST_PASSWORD }}
68- TWINE_REPOSITORY_URL : https://test.pypi.org/legacy/
42+ uv build --wheel
43+ - name : Test with pytest
6944 run : |
70- twine upload --skip-existing dist/*
71- - name : Publish bdist to pypi-test
72- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/test-') && matrix.os != 'ubuntu-latest'
73- env :
74- TWINE_USERNAME : ${{ secrets.PYPITEST_USERNAME }}
75- TWINE_PASSWORD : ${{ secrets.PYPITEST_PASSWORD }}
76- TWINE_REPOSITORY_URL : https://test.pypi.org/legacy/
45+ uv run pytest
46+
47+ - name : Upload wheel
48+ uses : actions/upload-artifact@v5
49+ with :
50+ name : dist-python-samplerate-ledfx-${{ matrix.os }}-py${{ matrix.python-version }}
51+ path : dist/*.whl
52+ if-no-files-found : error
53+
54+ publish :
55+ needs : build
56+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
57+ runs-on : ubuntu-latest
58+ environment :
59+ name : pypi
60+ url : https://pypi.org/p/python-samplerate-ledfx/
61+ permissions :
62+ id-token : write # Required for trusted publishing
63+ steps :
64+ - name : Install uv
65+ uses : astral-sh/setup-uv@v7
66+ - name : Download all artifacts
67+ uses : actions/download-artifact@v5
68+ with :
69+ path : dist
70+ pattern : dist-*
71+ merge-multiple : true
72+ - name : Display structure of downloaded files
73+ run : ls -R dist
74+ - name : Publish to PyPI
7775 run : |
78- twine upload --skip-existing dist/*
76+ uv publish --trusted-publishing always
0 commit comments