Upload Python Package #17
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
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
name: Upload Python Package | |
on: | |
release: | |
types: [created] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Setup Poetry 1.3 | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: "1.3" | |
- name: Install dependencies | |
run: | | |
make install | |
- name: Build version ${{github.ref_name}} | |
run: | | |
poetry run python build_version.py ${{github.ref_name}} | |
- name: Check versions are in sync | |
run: | | |
poetry run pytest tests/test_packaging.py | |
- name: Build and publish | |
run: | | |
poetry build | |
poetry publish -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} |