ci: fix release workflow by upgrading setuptools before build (#48) #54
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 | |
| permissions: | |
| contents: write # Required for semantic-release to create releases and push commits | |
| id-token: write # Required for trusted publishing | |
| jobs: | |
| # Skip test job - CI workflow already runs comprehensive tests on push to main | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.RELEASE_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| cache: pip | |
| cache-dependency-path: pyproject.toml | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "pyproject.toml" | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Upgrade setuptools | |
| run: uv pip install --system "setuptools>=61.0" | |
| - name: Release with Python Semantic Release | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: uv run semantic-release version | |
| - name: Publish to PyPI | |
| if: steps.app-token.outcome == 'success' | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| print-hash: true |