Build and publish Python π distributions π¦ to PyPI #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish Python π distributions π¦ to PyPI | |
on: | |
release: | |
types: [published] | |
env: | |
LSL_RELEASE_URL: "https://github.com/sccn/liblsl/releases/download/" | |
LSL_RELEASE: "1.16.2" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
deploy: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
permissions: | |
id-token: write | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- name: "ubuntu-24.04" | |
os: "ubuntu-latest" | |
pyarch: "x64" | |
- name: "windows-x64" | |
os: "windows-latest" | |
arch: "amd64" | |
pyarch: "x64" | |
- name: "windows-x86" | |
os: "windows-latest" | |
arch: "i386" | |
pyarch: "x86" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download liblsl (Windows) | |
if: matrix.config.os == 'windows-latest' | |
run: | | |
curl -L ${LSL_RELEASE_URL}/v${LSL_RELEASE}/liblsl-${LSL_RELEASE}-Win_${{ matrix.config.arch}}.zip -o liblsl.zip | |
unzip -oj liblsl.zip bin/lsl* -d src/pylsl/lib | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
architecture: ${{ matrix.config.pyarch }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v4 | |
- name: Build Package | |
run: uv build | |
- name: (Windows x64) Retarget wheel | |
if: matrix.config.name == 'windows-x64' | |
run: | | |
uv run python -m ensurepip | |
uv run python -m pip install wheel | |
for f in dist/pylsl*.whl; do uv run wheel tags --platform-tag win_amd64 "$f"; done | |
- name: (Windows 32) Retarget wheel | |
if: matrix.config.name == 'windows-x86' | |
run: | | |
uv run python -m ensurepip | |
uv run python -m pip install wheel | |
for f in dist/pylsl*.whl; do uv run wheel tags --platform-tag win32 "$f"; done | |
- name: Publish package distributions to PyPI | |
run: uv publish |