CD Pipeline #4
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 Pipeline | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| test_publish_package: | |
| name: publish package to test pypi | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: set up python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: 3.11 | |
| - name: install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: build package | |
| run: uv build | |
| - name: publish package | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
| repository-url: https://test.pypi.org/legacy/ | |
| publish: | |
| name: publish package to pypi | |
| runs-on: ubuntu-latest | |
| needs: test_publish_package | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing | |
| steps: | |
| - name: checkout code | |
| uses: actions/checkout@v4 | |
| - name: set up python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: 3.11 | |
| - name: install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| # - name: Add uv to PATH | |
| # run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: build | |
| run: uv build | |
| - name: publish | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} |