0.2.0 #5
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 | |
| on: | |
| release: | |
| types: [published] | |
| branches: | |
| - main | |
| jobs: | |
| publish: | |
| name: Publish 🚀 | |
| runs-on: ubuntu-latest | |
| env: | |
| VERSION: null | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up uv 🐍 | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Get version | |
| run: | | |
| grep "__version__ = " src/reproj/__init__.py | awk '{print "VERSION="$(NF)}' | tr -d \" >> $GITHUB_ENV | |
| - name: Build a binary wheel and a source tarball 🚧 | |
| run: uv build | |
| - name: Validate release tag | |
| run: | | |
| if [ "${GITHUB_REF#refs/tags/}" != "${VERSION}" ]; then exit 1; fi | |
| - name: Publish to Test PyPI 📦 | |
| if: contains(env.VERSION, 'a') | |
| uses: pypa/[email protected] | |
| with: | |
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
| repository-url: https://test.pypi.org/legacy/ | |
| - name: Publish to PyPI 📦 | |
| if: | | |
| !contains(env.VERSION, 'a') | |
| uses: pypa/[email protected] | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} |