ci(deps): update astral-sh/setup-uv action to v8 #301
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: | |
| pull_request: | |
| types: | |
| - closed | |
| - opened | |
| - reopened | |
| - synchronize | |
| branches: [main] | |
| jobs: | |
| release: | |
| name: Semantic version release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write # Required for adding the labels to the PR | |
| issues: write # Required for adding labels to the repository | |
| outputs: | |
| release: ${{ steps.get-version.outputs.release }} | |
| tag: ${{ steps.get-version.outputs.tag }} | |
| version: ${{ steps.get-version.outputs.version }} | |
| steps: | |
| - name: Get semantic version | |
| uses: RonaldPhilipsen/semVersie@v2.3.2 | |
| id: get-version | |
| with: | |
| add-pr-label: true | |
| label-prefix: false | |
| deploy: | |
| name: Deploy package distributions | |
| needs: release | |
| if: needs.release.outputs.release == 'true' && github.event.pull_request.merged | |
| runs-on: ubuntu-latest | |
| environment: release | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/create-github-app-token@v3 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v8.1.0 | |
| with: | |
| version: "latest" | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Set credentials for git | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| APP_SLUG: ${{ steps.app-token.outputs.app-slug }} | |
| run: | | |
| USER_ID=$(gh api "/users/${APP_SLUG}[bot]" --jq .id) | |
| git config --global user.name "${APP_SLUG}[bot]" | |
| git config --global user.email "${USER_ID}+${APP_SLUG}[bot]@users.noreply.github.com" | |
| - name: Update version in pyproject.toml | |
| env: | |
| VERSION: ${{ needs.release.outputs.version }} | |
| run: | | |
| sed -i "s/version = \"0.0.0\"/version = \"${VERSION}\"/" pyproject.toml | |
| git add pyproject.toml | |
| - name: Build package distributions | |
| run: | | |
| uv sync --no-dev | |
| uv build | |
| - name: Create commit and tag | |
| env: | |
| VERSION: ${{ needs.release.outputs.version }} | |
| TAG: ${{ needs.release.outputs.tag }} | |
| run: | | |
| git commit -m "chore: bump version to ${VERSION}" | |
| git tag -a ${TAG} -m "Release ${VERSION}" | |
| git push -f origin ${TAG} | |
| - name: Publish package distributions | |
| run: | | |
| uv publish | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| TAG: ${{ needs.release.outputs.tag }} | |
| run: > | |
| gh release create "${TAG}" | |
| dist/*.whl | |
| dist/*.tar.gz | |
| --generate-notes | |
| --verify-tag | |
| document: | |
| name: Deploy documentation | |
| needs: [release] | |
| if: github.event.pull_request.merged | |
| uses: ./.github/workflows/docs.yaml | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| secrets: inherit | |
| with: | |
| push: true |