Bump version: 0.3.3 → 0.3.4 #9
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| # Check if tag is on main branch | |
| check-branch: | |
| name: Check if tag is on main | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is-main: ${{ steps.check.outputs.is-main }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if tag is on main | |
| id: check | |
| run: | | |
| if git branch -r --contains ${{ github.ref_name }} | grep -q 'origin/main'; then | |
| echo "is-main=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "is-main=false" >> $GITHUB_OUTPUT | |
| fi | |
| # First run the existing CI workflow | |
| ci: | |
| name: Run CI | |
| uses: ./.github/workflows/ci.yml | |
| if: needs.check-branch.outputs.is-main == 'true' | |
| needs: check-branch | |
| # Release to PyPI after CI passes | |
| release: | |
| name: Release to PyPI | |
| runs-on: ubuntu-latest | |
| needs: [check-branch, ci] | |
| if: needs.check-branch.outputs.is-main == 'true' | |
| permissions: | |
| id-token: write # Required for trusted publishing to PyPI | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Build package | |
| run: uv build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true |