Release Python Package #5
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: Release Python Package | |
# Run when python test runs successfully on master branch | |
on: | |
workflow_run: | |
workflows: ["Python Test"] | |
branches: ["main"] | |
types: | |
- completed | |
jobs: | |
python-build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10"] | |
poetry-version: [1.4.1] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run image | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Build sdist and wheel | |
run: poetry build | |
- name: Publish to public pypi | |
run: | | |
poetry config pypi-token.pypi ${PYPI_TOKEN} | |
poetry publish | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |