Release #7
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: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g., 0.1.0)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.RELEASE_PAT }} | |
| - name: Configure git | |
| run: | | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor }}@users.noreply.github.com" | |
| - name: Update Cargo.toml version | |
| run: | | |
| sed -i 's/^version = ".*"/version = "${{ inputs.version }}"/' Cargo.toml | |
| - name: Commit version change | |
| run: | | |
| git add Cargo.toml | |
| git commit -m "chore: bump version to ${{ inputs.version }}" | |
| git push | |
| - name: Create and push tag | |
| run: | | |
| git tag "v${{ inputs.version }}" | |
| git push origin "v${{ inputs.version }}" | |
| - name: Create GitHub release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} | |
| run: | | |
| gh release create "v${{ inputs.version }}" \ | |
| --title "v${{ inputs.version }}" \ | |
| --generate-notes |