From 73770a7fd6a31965da431aa6f893bbd14b184fba Mon Sep 17 00:00:00 2001 From: Dave Xiong Date: Wed, 16 Oct 2024 15:33:12 +1000 Subject: [PATCH 1/4] Add bump version github workflow --- .github/workflows/bump-version.yaml | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/bump-version.yaml diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml new file mode 100644 index 00000000..90d4ced1 --- /dev/null +++ b/.github/workflows/bump-version.yaml @@ -0,0 +1,53 @@ +--- +name: Bump version +on: + workflow_dispatch: + inputs: + ref: + description: 'The branch checkout' + required: false + type: string + default: '' + new-version: + description: 'The new version to bump to' + required: true + type: string +jobs: + bump-version: + name: Bump version to ${{ inputs.new-version }} in ${{ inputs.ref }} + runs-on: ubuntu-latest + steps: + + - name: Check out the repo + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + + - name: Create a branch for the new version + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + + git switch --create "bump-version/${{ inputs.new-version }}" + + - name: Bump version in pom.xml files + run: | + echo "NEW_VERSION: ${{ inputs.new-version }}" + ./mvnw -q versions:set -DnewVersion=${{ inputs.new-version }} -DprocessAllModules + git commit -am "Bump verson to ${{ inputs.new-version }} in pom.xml files" + + - name: Bump version in package.json files + run: | + echo "NEW_VERSION: ${{ inputs.new-version }}" + cd kraken-app/kraken-app-portal + npm version ${{ inputs.new-version }} + cd ../.. + git commit -am "Bump version to ${{ inputs.new-version }} in package.json files" + + - name: Create a PR for the new version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git push -u origin "bump-version/${{ inputs.new-version }}" + gh pr create --title "build(misc): bump version to ${{ inputs.new-version }} in ${{ inputs.ref }}" --body "Bump version to ${{ inputs.new-version }} " --base ${{inputs.ref}} From dcde0a2da3d00acc00642ee8b9ca0c2532c1c07a Mon Sep 17 00:00:00 2001 From: Dave Xiong Date: Wed, 16 Oct 2024 15:40:21 +1000 Subject: [PATCH 2/4] rename ref to branch --- .github/workflows/bump-version.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml index 90d4ced1..79990b42 100644 --- a/.github/workflows/bump-version.yaml +++ b/.github/workflows/bump-version.yaml @@ -3,7 +3,7 @@ name: Bump version on: workflow_dispatch: inputs: - ref: + branch: description: 'The branch checkout' required: false type: string @@ -14,14 +14,14 @@ on: type: string jobs: bump-version: - name: Bump version to ${{ inputs.new-version }} in ${{ inputs.ref }} + name: Bump version to ${{ inputs.new-version }} in ${{ inputs.branch }} runs-on: ubuntu-latest steps: - name: Check out the repo uses: actions/checkout@v4 with: - ref: ${{ inputs.ref }} + ref: ${{ inputs.branch }} - name: Create a branch for the new version run: | @@ -50,4 +50,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git push -u origin "bump-version/${{ inputs.new-version }}" - gh pr create --title "build(misc): bump version to ${{ inputs.new-version }} in ${{ inputs.ref }}" --body "Bump version to ${{ inputs.new-version }} " --base ${{inputs.ref}} + gh pr create --title "build(misc): bump version to ${{ inputs.new-version }} in ${{ inputs.branch }}" --body "Bump version to ${{ inputs.new-version }} " --base ${{inputs.branch}} From 340595c6654da57b0d84b5be1e94d4ea78f80f18 Mon Sep 17 00:00:00 2001 From: Dave Xiong Date: Wed, 16 Oct 2024 15:44:11 +1000 Subject: [PATCH 3/4] add version into pull request title scope --- .github/workflows/lint-pull-request.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint-pull-request.yaml b/.github/workflows/lint-pull-request.yaml index 20c249d8..b9ef63a4 100644 --- a/.github/workflows/lint-pull-request.yaml +++ b/.github/workflows/lint-pull-request.yaml @@ -30,6 +30,7 @@ jobs: api portal ci-cd + version misc # Configure that a scope must always be provided. requireScope: true From 60fc8cb88e4241aefd2a10a825f05fff44929203 Mon Sep 17 00:00:00 2001 From: Dave Xiong Date: Wed, 16 Oct 2024 15:48:26 +1000 Subject: [PATCH 4/4] Add CI/CD/Document into a new change of type --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1417649b..bcb7b4dd 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -32,6 +32,7 @@ - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) +- [ ] CI/CD or documentation update (changes to CI/CD pipeline or documentation) ## Checklist