Skip to content
name: Publish tagged releases to PyPI
on:
release:
types:
- published
jobs:
lint_and_typecheck:
name: Lint and type-check
uses: ./.github/workflows/linting_and_type_checking.yml
run_fast_tests:
name: Run fast tests
uses: ./.github/workflows/run_fast_tests.yml
run_slow_tests:
name: Run slow tests
uses: ./.github/workflows/run_slow_tests.yml
publish:
name: Build wheel and publish to test-PyPI, and then PyPI, and publish docs
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Poetry environment
uses: ./.github/setup-poetry-env
with:
python-version: ${{ matrix.python-version }}
- name: Setup test-PyPI credentials
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
- name: Build the wheel
run: poetry build
- name: Publish to test-PyPI
run: poetry publish -r testpypi
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish
- name: Build and publish docs
run: poetry run mkdocs gh-deploy --force