pypi-publish #4
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
| on: | |
| workflow_dispatch: | |
| release: | |
| types: | |
| - released | |
| - prereleased | |
| name: pypi-publish | |
| env: | |
| PYTHONUNBUFFERED: "1" | |
| jobs: | |
| pypi-publish: | |
| name: pypi-publish | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Build Python dist | |
| working-directory: python | |
| run: | | |
| # Copy over any necessary data files | |
| mkdir -p ccao/data/ | |
| cp ../data-raw/vars_dict.csv ccao/data/vars_dict.csv | |
| # Build the package | |
| uv build | |
| - name: Publish package distribution to test PyPI | |
| if: ${{ github.event.action == 'prereleased' }} | |
| env: | |
| url: https://test.pypi.org/legacy/p/ccao | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| - name: Publish package distribution to PyPI | |
| if: ${{ github.event.action == 'released' }} | |
| env: | |
| url: https://pypi.org/p/ccao | |
| uses: pypa/gh-action-pypi-publish@release/v1 |