Update deploy_testpypi.yml #11
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: Build and Publish to TestPyPI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build_package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up UV | |
| uses: astral-sh/setup-uv@v7.6.0 | |
| with: | |
| version: '0.11.1' # Use the latest Python 3 version | |
| - name: Install Python | |
| run: uv python install 3.11 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Build Package | |
| run: uv build | |
| - name: Upload distribution | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dist | |
| path: dist/ | |
| publish_testpypi: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build_package | |
| environment: testpypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Retrieve release dist | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dist | |
| path: dist/ | |
| - name: Publish package distributions to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| packages-dir: dist/ | |