Prepare Release #56
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: Prepare Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| increment: | |
| description: "How to increment version (use `version` to specify version)" | |
| required: true | |
| type: choice | |
| default: minor | |
| options: | |
| - major | |
| - minor | |
| - patch | |
| - version | |
| version: | |
| description: "The full version to release (first choose 'version' from the 'increment' dropdown)" | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| prepare-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.QLTY_APP_ID }} | |
| private-key: ${{ secrets.QLTY_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| - name: Git config | |
| run: | | |
| git config --global core.longpaths true | |
| git config --global core.autocrlf false | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install cargo-release | |
| uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 | |
| with: | |
| repo: crate-ci/cargo-release | |
| tag: v0.25.17 | |
| - name: Bump version | |
| id: version | |
| run: | | |
| cargo release version \ | |
| --execute \ | |
| --no-confirm \ | |
| ${{ inputs.increment == 'version' && inputs.version || inputs.increment || 'minor' }} | |
| echo "version=$(cargo metadata --format-version 1 | jq -r ".workspace_members[0]" | cut -d# -f2)" >> "$GITHUB_OUTPUT" | |
| - name: Commit changes | |
| uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| title: Release ${{ steps.version.outputs.version }} | |
| body: Automated PR for release ${{ steps.version.outputs.version }} | |
| branch: release-${{ steps.version.outputs.version }} | |
| sign-commits: true | |
| commit-message: Release ${{ steps.version.outputs.version }} |