-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for CLI releases (#160)
This adds a manual workflow for the CLI release process to update `bufbuild/buf` to the version being released.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Update bufbuild/buf Version | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: string | ||
description: The version you intend to release (e.g. x.y.z) | ||
required: true | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
env: | ||
RELEASE_BUF_VERSION: ${{ github.event.inputs.version }} | ||
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Validate input version | ||
if: ${{ startsWith(github.event.inputs.version, 'v') }} | ||
run: | | ||
echo "error: version must not start with 'v'." | ||
exit 1 | ||
- name: Checkout repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.app_token.outputs.token }} | ||
- name: Update Buf Version | ||
run: make updatebufversion | ||
- name: Create PR | ||
run: | | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
BRANCH="release/v${RELEASE_BUF_VERSION}" | ||
git switch -C ${BRANCH} | ||
git add make/go/dep_buf.mk | ||
git commit -m "Update version to ${RELEASE_BUF_VERSION}" | ||
git push --set-upstream origin --force ${BRANCH} | ||
gh pr create --title "Update buf version to v${RELEASE_BUF_VERSION}" --body "Update buf version to newly released version, ${RELEASE_BUF_VERSION}." |
This file contains 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