Publish new release to pypi #4
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 new release to pypi | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry pytest pyyaml | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
- name: Test | |
run: poetry run pytest | |
- name: Build | |
run: | | |
poetry version $(git describe --tags --abbrev=0) | |
poetry build | |
- name: Publish | |
run: poetry publish -r |