Skip to content

Publish to PyPI

Publish to PyPI #9

name: Publish to PyPI
on:
workflow_dispatch: # Enable manual runs
jobs:
publish_to_pypi:
runs-on: ubuntu-latest
needs: run_tests # Depend on the 'run_tests' job in the 'Tests' workflow

Check failure on line 9 in .github/workflows/publish_to_pypi.yml

View workflow run for this annotation

GitHub Actions / Publish to PyPI

Invalid workflow file

The workflow is not valid. .github/workflows/publish_to_pypi.yml (Line: 9, Col: 12): Job 'publish_to_pypi' depends on unknown job 'run_tests'.
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Poetry
run: |
pip install poetry
- name: Install Dependencies
run: |
poetry install
- name: Build Package
run: |
poetry build
- name: Update Version
run: |
poetry version patch # Use 'minor' or 'major' for minor or major version bumps
- name: Publish Package
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish
# A dummy job that has no dependencies (GitHub Actions needs each workflow to have at least one job with dependencies)
optional_job:
runs-on: ubuntu-latest
steps:
- name: Dummy job
run: echo "This is a dummy job with no dependencies"