2.1.4 #25
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
name: Release on PyPI | |
on: | |
release: | |
types: [released] | |
workflow_dispatch: | |
branches: [main] | |
inputs: | |
version: | |
description: 'Version' | |
required: true | |
jobs: | |
pypi_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | |
- name: Add Poetry to path | |
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
poetry install | |
sudo apt-get install progress | |
- name: Run tests | |
run: poetry run pytest | |
- name: Set version based on tag or input | |
run: | | |
if [[ $GITHUB_EVENT_NAME == 'release' ]]; then | |
VERSION=${GITHUB_REF#refs/tags/} | |
else | |
VERSION=${{ github.event.inputs.version }} | |
fi | |
poetry version $VERSION | |
- name: Configure Poetry | |
run: poetry config pypi-token.pypi "${{ secrets.PYPI_TOKEN }}" | |
- name: Publish package | |
run: poetry publish --build |