Release #19
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: | |
| title: | |
| description: "Release title (blank for tag)" | |
| required: false | |
| bump: | |
| description: "Bump type (major/minor/patch/auto)" | |
| default: "auto" | |
| required: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: deployment | |
| name: Release new version | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ssh-key: ${{ secrets.DEPLOY_KEY }} | |
| - name: Eat own dogfood | |
| id: bumper | |
| uses: ./ | |
| with: | |
| bump: ${{ github.event.inputs.bump }} | |
| - name: Create a release name | |
| id: release_name | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| var retval = '${{ steps.bumper.outputs.next }}' | |
| if ('${{ github.event.inputs.title }}') { | |
| retval = retval.concat(' - ${{ github.event.inputs.title }}') | |
| } | |
| core.setOutput('value', retval) | |
| - name: Create a release | |
| id: gh_release | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const repo_name = context.payload.repository.full_name | |
| const response = await github.request('POST /repos/' + repo_name + '/releases', { | |
| tag_name: '${{ steps.bumper.outputs.next }}', | |
| name: '${{ steps.release_name.outputs.value }}', | |
| generate_release_notes: true | |
| }) | |
| core.setOutput('html_url', response.data.html_url) | |
| - name: Update usage example | |
| run: > | |
| sed -i | |
| 's/uses\: tomerfi\/version-bumper-action@.*/uses\: tomerfi\/version-bumper-action@${{ steps.bumper.outputs.next }}/g' | |
| README.md | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Setup SSH signing | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.SIGNING_KEY }}" > ~/.ssh/signing_key | |
| chmod 600 ~/.ssh/signing_key | |
| git config gpg.format ssh | |
| git config user.signingkey ~/.ssh/signing_key | |
| git config commit.gpgsign true | |
| - name: Push modifications | |
| run: | | |
| git add README.md | |
| git commit -m "docs: update README usage section with ${{ steps.bumper.outputs.next }} [skip ci]" | |
| git push |