Merge pull request #781 from minekube/codex/sync-velocity-pr-14 #80
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 Please | |
| # Renovate can now auto-merge geyserlite bumps with a fix(deps): commit. | |
| # This workflow turns those conventional commits on master into normal Gate | |
| # GitHub releases. The release-please tag is created with GITHUB_TOKEN, so it | |
| # will not recursively trigger ci.yml by tag push; the trigger-release job | |
| # explicitly dispatches ci.yml on the new tag so GoReleaser uploads artifacts. | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| actions: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.rp.outputs.release_created }} | |
| tag_name: ${{ steps.rp.outputs.tag_name }} | |
| pr_number: ${{ steps.rp.outputs.pr }} | |
| steps: | |
| - uses: googleapis/release-please-action@v5 | |
| id: rp | |
| with: | |
| config-file: .release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| - name: Auto-merge release PR | |
| if: ${{ steps.rp.outputs.pr }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| PR_NUMBER=$(echo '${{ steps.rp.outputs.pr }}' | jq -r '.number') | |
| gh pr merge "$PR_NUMBER" \ | |
| --repo "${{ github.repository }}" \ | |
| --merge | |
| # Merges done with GITHUB_TOKEN do not trigger a new push workflow. | |
| # Run this workflow again on master so release-please observes the | |
| # merged release PR and creates the tag/GitHub release. | |
| gh workflow run release-please.yml \ | |
| --repo "${{ github.repository }}" \ | |
| --ref "${{ github.ref_name }}" | |
| trigger-release: | |
| needs: release-please | |
| if: needs.release-please.outputs.release_created == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Dispatch ci.yml on the new tag | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run ci.yml \ | |
| --repo "${{ github.repository }}" \ | |
| --ref "${{ needs.release-please.outputs.tag_name }}" |