point test.pypi.org to github #2
Workflow file for this run
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: Publish to TestPyPI | |
| on: | |
| push: | |
| tags: | |
| - "v*" # Any tag starting with v, like v0.1.0 | |
| jobs: | |
| build-and-publish: | |
| name: Build and publish to TestPyPI | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # REQUIRED for Trusted Publishing | |
| contents: read | |
| environment: | |
| name: testpypi | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish to TestPyPI (Trusted Publishing) | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |