v0.8.3 🎨 #31
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 on PyPI | |
on: | |
release: | |
types: | |
- published | |
branches: | |
- main | |
- master | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: # TODO: debug only | |
jobs: | |
publish: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# ubuntu-20.04 is required to build wheels for older OS (clusters...) | |
os: [ubuntu-20.04, ubuntu-latest, windows-latest] | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- name: Check out the repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 1 | |
submodules: 'true' | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Use frozen pip version | |
run: | | |
pip install --constraint=.github/constraints.txt pip wheel | |
pip --version | |
- name: Install poetry | |
run: | | |
# Cannot install as recomended on https://python-poetry.org/docs/#installation | |
# pipx uses 'system' python, which version may be not in our supported range | |
# install script depends on OS and may fail on Windows | |
# Let's use pip | |
pip install --constraint=.github/constraints.txt poetry | |
poetry --version | |
poetry config --local virtualenvs.create false | |
poetry version | |
- name: Install this package | |
run: | | |
poetry install | |
- name: Build wheel | |
run: | | |
poetry build -f wheel | |
- name: Build sdist | |
run: poetry build -f sdist | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | |
- name: Publish package for ${{ matrix.os }}, python ${{ matrix.python-version }} | |
run: poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }} |