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@v4 | |
| with: | |
| ref: ${{ github.event.release.target_commitish }} | |
| - name: Use Python 3.9 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.9" | |
| - name: Install Poetry | |
| run: python -m pip install poetry==1.8.5 | |
| - 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: poetry version "${VERSION}" | |
| - name: Install Dependencies | |
| run: poetry install | |
| - name: Run Tests | |
| run: poetry run pytest tests/ -q -m "not live" | |
| - name: Run Import Smoke Test | |
| run: | | |
| poetry 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: poetry build | |
| - name: Publish Package | |
| run: poetry publish -u __token__ -p "${{ secrets.PYPI_TOKEN }}" | |
| - name: Commit Version Changes | |
| run: | | |
| git add pyproject.toml | |
| git diff --cached --quiet && exit 0 | |
| git commit -m "bump version to ${VERSION}" | |
| - name: Push Version Changes To GitHub | |
| run: git push |