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 New Release To PyPI | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| name: Publish New Release To PyPI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.release.target_commitish }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.28" | |
| enable-cache: true | |
| - name: Use Python 3.9 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.9" | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "GitHub Release Bot" | |
| git config --global user.email "deploy@tardis.dev" | |
| - name: Resolve Release Version | |
| run: | | |
| VERSION="${{ github.event.release.tag_name }}" | |
| VERSION="${VERSION#v}" | |
| echo "VERSION=${VERSION}" >> "$GITHUB_ENV" | |
| - name: Update Package Version | |
| run: uv version "${VERSION}" | |
| - name: Run Tests | |
| run: uv run pytest tests/ -q -m "not live" | |
| - name: Run Import Smoke Test | |
| run: | | |
| uv run python -c "from tardis_dev import DEFAULT_ENDPOINT, DEFAULT_DATASETS_ENDPOINT, DEFAULT_CACHE_DIR, Channel, Response, replay, download_datasets, download_datasets_async, get_exchange_details, get_exchange_details_async, clear_cache, default_file_name; print('OK')" | |
| - name: Build Package | |
| run: uv build --no-sources | |
| - name: Publish Package | |
| run: uv publish --token "${{ secrets.PYPI_TOKEN }}" --no-attestations | |
| - name: Commit Version Changes | |
| run: | | |
| git add pyproject.toml uv.lock | |
| git diff --cached --quiet && exit 0 | |
| git commit -m "bump version to ${VERSION}" | |
| - name: Push Version Changes To GitHub | |
| run: git push |