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 cgatcore wheels to PyPI and TestPyPI | |
| on: | |
| push: | |
| branches: | |
| - v[0-9]+.[0-9]+.x | |
| tags: | |
| - v* | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build_sdist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout cgatcore | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install build and create distributions | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| python -m build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| upload_pypi: | |
| needs: [build_sdist] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - name: Publish distribution to Test PyPI | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
| repository_url: https://test.pypi.org/legacy/ | |
| - name: Publish distribution to PyPI | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |