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 #287: GHA config for release #288

Merged
merged 3 commits into from
Jun 4, 2024
Merged
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
45 changes: 45 additions & 0 deletions .github/workflows/maven-update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update version with Maven
# - validate that there is no dependency on snapshot
# - update version to non-snapshot
# - commit and tag
# - update version to snapshot
# - push changes

on:
workflow_dispatch:
inputs:
update_type:
description: Update type
required: true
type: choice
options:
# `major` not yet supported
- minor
- bugfix

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

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: maven
- name: Run Maven release:prepare
run: |
echo ${{ inputs.update_type }}
if [ ${{ inputs.update_type }} == "minor" ]; then
mvn -B -U -DdryRun=true release:prepare -DtagNameFormat=@{project.version} -DprojectVersionPolicyId=SemVerVersionPolicy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added -DdryRun=true to fine-tune the action. Will be removed in a consecutive PR.

elif [ ${{ inputs.update_type }} == "bugfix" ]; then
mvn -B -U -DdryRun=true release:prepare -DtagNameFormat=@{project.version}
else
echo "Not supported type: ${{ inputs.update_type }}"
exit 1
fi