qcastel / github-actions-maven-release

Release your Java application and publish artifacts
129 stars 38 forks source link

Configuration of version format #35

Closed BernhardFuchs closed 3 years ago

BernhardFuchs commented 3 years ago

When we do a manual releases from terminal we add following parameter to release:perform:

-DreleaseVersion=0.2.0
-DdevelopmentVersion=0.3-SNAPHSOT

The format of the versions differ slightly from maven standard versions but we would prefer to keep our format. Is it possible to configure the action that way?

qcastel commented 3 years ago

What would you like this github action do exactly? (just to be clear, got a feeling of what you want to do)

This is what the action is doing today around version numbers https://github.com/qcastel/docker-maven-release/blob/master/release.sh#L111

I can implement an override perhaps, but first I prefer to capture your requirements with more details.

An example of a version number history would probably help me visualise what you are aiming to achieve.

BernhardFuchs commented 3 years ago

Release tags

We want to include a trailing 0 for the patch version on the release tag like seen here with version 0.1.0:

image

Development versions

We don't want to include a trailing 0.

See this example: https://github.com/decentralized-identity/did-common-java/blob/f2465e822dce94a46d46f48a6ee702fb8260f3a9/pom.xml#L9

We never use snapshots version on patches so e.g 0.1.1-SNAPSHOT is never used.

qcastel commented 3 years ago

Hello @BernhardFuchs ,

Thanks for detailling your requirement. What I think can work for you is a way to fully customise the version format.

For that, I created an option that I described in the documentation: https://github.com/qcastel/github-actions-maven-release#customize-version

This should allow you to remove the trailing 0 on a minor release.

let me know if this worked for you.

BernhardFuchs commented 3 years ago

The code changes worked but I had to remove \ and " from the example in the README:

maven-development-version-number: ${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}-SNAPSHOT

I also created PR's to do the same with the release number
https://github.com/qcastel/docker-maven-release/pull/1
https://github.com/qcastel/github-actions-maven-release/pull/37

qcastel commented 3 years ago

Thanks @BernhardFuchs for your contribution!

I did the round up of your PRs and released https://github.com/qcastel/github-actions-maven-release/releases/tag/v1.12.23

Give it a try and tell me if that does the job for you

BernhardFuchs commented 3 years ago

There is still an issue with the release-version. It's not forwarded to the docker container as can be seen in this logs

An INPUT and an env variable for e.g. the development version are set:

-e INPUT_MAVEN-DEVELOPMENT-VERSION-NUMBER -e MAVEN_DEVELOPMENT_VERSION_NUMBER

but only an INPUT for the release version:

-e INPUT_MAVEN-RELEASE-VERSION-NUMBER

and no corrensponding docker env variable.

qcastel commented 3 years ago

Try now with version https://github.com/qcastel/github-actions-maven-release/releases/tag/v1.12.24

I fixed the github actions https://github.com/qcastel/github-actions-maven-release/commit/3f39d8f1b6fd3a2feeb084fb48e15f8d5ace1892

BernhardFuchs commented 3 years ago

Ok, now it works as expected.
Thx for your support