refacto - plugin system #1
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: Publish Python distribution to PyPI and TestPyPI | |
# based on https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
on: | |
pull_request: | |
paths-ignore: | |
- 'doc/**' | |
- 'tests/**' | |
- 'CHANGELOG.md' | |
- 'TODO.md' | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
# poetry 1.8.4 | |
run: pipx install git+https://github.com/python-poetry/poetry.git@6a071c181ad82ec3a5d4ecd54d50d08a75470e78 | |
- name: Build a binary wheel | |
# this creates a ./dist directory at repo's root | |
run: poetry build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
publish-to-testpypi: | |
name: Publish Python distribution to TestPyPI | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Configure poetry for TestPyPI | |
run: poetry config repositories.test-pypi https://test.pypi.org/legacy/ | |
- name: Publish distribution to TestPyPI | |
run: poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }} --repository test-pypi |