diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9f59b2a..4fe4f8a 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -8,30 +8,31 @@ on: jobs: publish: runs-on: ubuntu-latest + steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v4 + # Check out the repository code + - name: Checkout code + uses: actions/checkout@v4 + + # Set up Python - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.10" - # Issue ref: https://github.com/actions/setup-python/issues/436 - # cache: "pip" cache-dependency-path: pyproject.toml - - uses: actions/cache@v3 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish + + # Install build dependencies - name: Install build dependencies - if: steps.cache.outputs.cache-hit != 'true' - run: pip install build + run: | + python -m pip install --upgrade pip + pip install build twine + + # Build the distribution - name: Build distribution run: python -m build - - name: Publish + + # Publish to PyPI + - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.11 with: password: ${{ secrets.PYPI_API_TOKEN }}