Skip to content

Merge pull request #6 from LedFx/build/migrate-to-uv #12

Merge pull request #6 from LedFx/build/migrate-to-uv

Merge pull request #6 from LedFx/build/migrate-to-uv #12

Workflow file for this run

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