Update README.rst (#229) #187
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 | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
# By default, GitHub will maximize the number of jobs run in parallel | |
# depending on the available runners on GitHub-hosted virtual machines. | |
# max-parallel: 8 | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
env: | |
TOXENV: ${{ matrix.tox-env }} | |
TOX_SKIP_MISSING_INTERPRETERS: False | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run pre-commit hook | |
uses: pre-commit/action@v3.0.1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip version | |
run: pip install -U pip | |
- name: Install test dependencies | |
run: pip install tox tox-gh-actions poetry==1.4.0 | |
- name: Run tox | |
run: tox | |
deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
if: endsWith(github.ref, '/master') | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install build dependencies | |
run: | | |
pip install poetry | |
- name: Fetch version | |
id: fetch_version | |
run: echo "version_nr=$(poetry version -s)" >> $GITHUB_OUTPUT | |
- name: Build a binary wheel and a source tarball | |
# Note: poetry build required to support CLI script entrypoint in pyproject.toml?! | |
run: | | |
poetry build --no-interaction | |
- name: Test PyPI Publishing | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_DEPLOYMENT_API_KEY }} | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
- name: Create GitHub Release | |
id: create_gh_release | |
uses: ncipollo/release-action@v1 | |
env: | |
VERSION: ${{ steps.fetch_version.outputs.version_nr }} | |
with: | |
tag: ${{env.VERSION}} | |
name: Release ${{env.VERSION}} | |
draft: false | |
prerelease: false | |
skipIfReleaseExists: true | |
- name: PyPI Publishing | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_DEPLOYMENT_API_KEY }} | |
skip-existing: true |