researchgate / gradle-release

gradle-release is a plugin for providing a Maven-like release process for projects using Gradle
MIT License
868 stars 220 forks source link

Provide ability to skip the step of committing SNAPSHOT version to master #343

Open Vydruth opened 3 years ago

Vydruth commented 3 years ago

I am using the gradle release plugin, I see that when we run gradle release when everything works we have 2 commits to our repo's master branch,

  1. Changes the previous SNAPSHOT version to a new release version in the gradle.properties file
  2. Changes the new release version to a newer snapshot version in the gradle.properties file

I would like to skip the second step. But I did not find any way to do it in the documentation mentioned in https://github.com/researchgate/gradle-release

Am I missing something? Is there a way to skip committing the snapshot version? If yes how do I do it? The command I am using to do it:

gradle release \ -Prelease.useAutomaticVersion=true \ -Prelease.releaseVersion=$(echo $(git tag) | awk -F. '{print $1 "." $2 "." $3+1}') \ -Prelease.newVersion=$(echo $(echo $(git tag) | awk -F. '{print $1 "." $2 "." $3+1}') | awk -F. '{print $1 "." $2 "." $3+1 "-SNAPSHOT"}') \ -PfailOnCommitNeeded=false \ -PfailOnPublishNeeded=false

TIA!

Vydruth commented 3 years ago

If that is not already supported I think it is a good feature to add.

nngo commented 3 years ago

have you tried setting next version to be the same to see if it skips step 2? e.g.

gradle release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=1.0.1 -Prelease.newVersion=1.0.1
Vydruth commented 3 years ago

Nope, I haven't tried that. Will try and get back with you. Even if that works, I think that would be a sloppy workaround. :)

SankarRaman-S commented 7 months ago

Vydruth, Have you tried this ? Looking for a similar option to skip the snapshot version update on master.

Hillkorn commented 3 months ago

You can disable the updateVersion & commitNewVersion task to skip the commit of the this.