Cut 3.8.0 #290
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: Version | |
| run-name: Cut ${{ github.event.inputs.version }} | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Version to cut | |
| required: true | |
| jobs: | |
| tag: | |
| name: Tag | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| token: ${{ secrets.GH_TOKEN }} | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| git_committer_name: ${{ secrets.GIT_USER_NAME }} | |
| git_committer_email: ${{ secrets.GIT_USER_EMAIL }} | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| # uv normalizes the semver version semantic-release computes | |
| # (3.0.0-beta.1) to PEP 440 (3.0.0b1), which is what gets committed, | |
| # tagged and published. The Semantic Release workflow mirrors that tag | |
| # back to semver so it can pick up where the last prerelease left off. | |
| - name: Cut ${{ github.event.inputs.version }} version | |
| run: | | |
| uv version "${{ github.event.inputs.version }}" | |
| just version | |
| # semantic-release only treats a prerelease tag as released when a note | |
| # records the channel it went out on, so record it here, once the release | |
| # exists. The note is keyed to the commit rather than the tag, which is | |
| # what lets the mirrored semver tag pick it up. | |
| - name: Record prerelease channel | |
| run: | | |
| tag="v$(uv version --short)" | |
| case "$(uv version --short)" in | |
| *.*.*a[0-9]*) channel=alpha ;; | |
| *.*.*b[0-9]*) channel=beta ;; | |
| *.*.*rc[0-9]*) channel=rc ;; | |
| *) echo "Stable release, no channel note required."; exit 0 ;; | |
| esac | |
| git notes --ref "semantic-release-$tag" add --force \ | |
| --message "{\"channels\":[\"$channel\"]}" "$tag^{commit}" | |
| git push origin "refs/notes/semantic-release-$tag" | |
| echo "Recorded $tag on the '$channel' channel." |