Bump major version #2
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
name: Bump major version | |
on: | |
workflow_dispatch: {} | |
permissions: {} | |
jobs: | |
prepare-release: | |
permissions: | |
contents: write # for peter-evans/create-pull-request to create branch | |
pull-requests: write # for peter-evans/create-pull-request to create a PR | |
name: Automatically update major version | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# Get the current major version from go.mod and save it as a variable. | |
- name: Get target version | |
id: get-target-version | |
run: | | |
set -ue | |
CURRENT_VERSION=$(grep 'module github.com/argoproj/argo-cd' go.mod | awk '{print $2}' | sed 's/.*\/v//') | |
echo "TARGET_VERSION=$((CURRENT_VERSION + 1))" >> $GITHUB_OUTPUT | |
- name: Run script to bump the version | |
run: | | |
hack/bump-major-version.sh | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 | |
with: | |
commit-message: "Bump major version to ${{ steps.get-target-version.outputs.TARGET_VERSION }}" | |
title: "Bump major version to ${{ steps.get-target-version.outputs.TARGET_VERSION }}" | |
body: | | |
Congrats! You've just bumped the major version to ${{ steps.get-target-version.outputs.TARGET_VERSION }}. | |
Next steps: | |
- [ ] Merge this PR | |
- [ ] Add an upgrade guide to the docs for this version | |
branch: bump-major-version | |
branch-suffix: random | |
signoff: true |