Publish to PyPI #102
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
# workflow automates the Python package publishing process | |
# to PyPI upon pushes to the main branch or manual triggers, | |
# incrementing version if needed. | |
name: Publish to PyPI | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.actor != 'github-actions[bot]' # This line prevents the loop | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' # Specify a compatible Python version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Re-run poetry lockfile | |
run: poetry lock # Removed the --no-update option | |
- name: Install project dependencies | |
run: poetry install | |
- name: Build package | |
run: poetry build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |