Skip to content

Commit

Permalink
Creating GH Action to automatically bump the version of the project a…
Browse files Browse the repository at this point in the history
…nd commit the new version to the branch. (#336)
  • Loading branch information
jmartinez5120 authored Feb 15, 2025
1 parent d42d2db commit de4ef61
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .github/workflows/bump-version.yml
name: Bump Version

# Allows manual trigger with a newVersion input.
on:
workflow_dispatch:
inputs:
newVersion:
description: 'New version to set'
required: true
default: '1.0.1'

jobs:
bump-version:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repo.
- name: Checkout code
uses: actions/checkout@v3

# Step 2: Use Maven Versions Plugin to update the version across all modules.
- name: Set Maven version
run: mvn versions:set -DnewVersion=${{ github.event.inputs.newVersion }} -DprocessAllModules=true

# Step 3: Commit the changes using a GitHub Action.
- name: Commit version bump changes
uses: EndBug/add-and-commit@v9
with:
message: 'Bump version to ${{ github.event.inputs.newVersion }}'
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,11 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.18.0</version>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
Expand Down

0 comments on commit de4ef61

Please sign in to comment.