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

Fix #53: Config for release #54

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
54 changes: 54 additions & 0 deletions .github/workflows/maven-update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
workflow_call:
inputs:
java_version:
type: string
description: set version of java used to run the maven
default: '21'
server-id:
type: string
description: server for reading the artifacts, should be always jfrog-central
default: jfrog-central
required: false
directory_path:
type: string
description: directory with pom.xml to be executed
default: .
update_type:
description: Update type (`minor` or `bugfix`; `major` not yet supported).
required: true
type: string

jobs:
update-version:
name: Update version
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ inputs.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java_version }}
distribution: 'temurin'
server-id: ${{inputs.server-id}} #server id has to be passed this way it will not work via env in the test step
server-username: INTERNAL_USERNAME
server-password: INTERNAL_PASSWORD
cache: maven
- name: Run Maven release:prepare # https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html
run: |
echo ${{ inputs.update_type }}
if [ ${{ inputs.update_type }} == "minor" ]; then
mvn -B -U release:prepare -DtagNameFormat=@{project.version} -DprojectVersionPolicyId=SemVerVersionPolicy
elif [ ${{ inputs.update_type }} == "bugfix" ]; then
mvn -B -U release:prepare -DtagNameFormat=@{project.version}
else
echo "Not supported type: ${{ inputs.update_type }}"
exit 1
fi
env:
INTERNAL_USERNAME: ${{ secrets.JFROG_USERNAME }}
INTERNAL_PASSWORD: ${{ secrets.JFROG_PASSWORD }}
BRANCH: ${{ github.ref_name }}