CD - Publish to TestPyPI #17
This file contains hidden or 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: CD - Publish to TestPyPI | |
| on: | |
| workflow_run: | |
| workflows: ["CI - Run Tox Tests"] | |
| types: | |
| - completed | |
| jobs: | |
| build: | |
| name: Build distribution | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install pypa/build | |
| run: python3 -m pip install build --user | |
| - name: Build a binary wheel and a source tarball | |
| run: python3 -m build | |
| - name: Upload the distribution packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-${{ matrix.python-version }} | |
| path: dist | |
| publish-to-testpypi: | |
| name: Publish Python distribution to TestPyPI | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/p/fakernaija | |
| permissions: | |
| id-token: write # Required for OIDC authentication | |
| steps: | |
| - name: Download the distribution packages | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: dist-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Publish distribution to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |