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 Package | |
on: | |
release: | |
types: [created] | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.12", "3.11", "3.10"] | |
poetry-version: ["1.6.1", "1.7.1"] | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup python and poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: install dependencies | |
run: poetry install --with test --without dev | |
- name: run the tests (sanity check) | |
run: | | |
poetry run pytest | |
- name: configure poetry | |
run: | | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
- name: build and publish package | |
if: matrix.python-version == '3.10' && matrix.poetry-version == '1.7.1' | |
run: poetry publish --build |