Publish new release to pypi #8
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@v4 | |
with: | |
fetch-depth: '0' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
poetry install | |
poetry add pytest | |
- name: Test | |
run: poetry run pytest tests | |
- name: Build | |
run: | | |
poetry version $(git describe --tags --abbrev=0) | |
poetry build | |
- name: Publish | |
run: poetry publish |