Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(ci-cd): add bump version github workflow #15

Merged
merged 5 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/bump-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Bump version
on:
workflow_dispatch:
inputs:
branch:
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.branch }}
runs-on: ubuntu-latest
steps:

- name: Check out the repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- 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.branch }}" --body "Bump version to ${{ inputs.new-version }} " --base ${{inputs.branch}}
1 change: 1 addition & 0 deletions .github/workflows/lint-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
api
portal
ci-cd
version
misc
# Configure that a scope must always be provided.
requireScope: true
Expand Down
Loading