fix(ci): use semantic-release version for pypi publishing #10
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: | |
| branches: [main, next, beta] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync --all-groups | |
| - name: Test before release | |
| run: | | |
| uv run pytest | |
| - name: Bootstrap initial semantic-release tag | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| if ! git tag -l "v*" | grep -q .; then | |
| echo "No semantic-release tags found. Bootstrapping v0.0.0" | |
| git tag v0.0.0 | |
| git push origin v0.0.0 | |
| else | |
| echo "Existing semantic-release tags found. Skipping bootstrap." | |
| fi | |
| - name: Semantic release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
| run: uv run semantic-release version |