Skip to content

Workflow file for this run

name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
on:
release:
types: [published]
env:
LSL_RELEASE_URL: 'https://github.com/sccn/liblsl/releases/download/v1.16.2/'
LSL_RELEASE: '1.16.2'
defaults:
run:
shell: bash
jobs:
deploy:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "ubuntu-22.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@master
- name: Download liblsl (Windows)
if: matrix.config.os == 'windows-latest'
run: |
curl -L ${LSL_RELEASE_URL}/liblsl-${LSL_RELEASE}-Win_${{ matrix.config.arch}}.zip -o liblsl.zip
unzip -oj liblsl.zip bin/lsl* -d pylsl/lib
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: "3.x"
architecture: ${{ matrix.config.pyarch }}
- name: Install pypa/build
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: |
python -m build --wheel --outdir dist/
- name: Publish using Twine (Windows)
if: matrix.config.os == 'windows-latest'
run: |
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# This fails because I don't have access to `pylsl` project there.
# - name: Publish distribution πŸ“¦ to Test PyPI
# if: (github.event.release.prerelease && (matrix.config.os != 'windows-latest'))
# uses: pypa/gh-action-pypi-publish@unstable/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
# skip_existing: true
#
- name: Publish distribution πŸ“¦ to PyPI
if: ((matrix.config.os != 'windows-latest') && !github.event.release.prerelease)
uses: pypa/gh-action-pypi-publish@unstable/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}