Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Releasing new version with protected branch #232

Answered by olamy
plamentotev asked this question in Q&A
Discussion options

Hi,

Looks like the master branch is now protected and requires PR. I wonder how would releases would work, what is the process?

You must be logged in to vote

@plamentotev I have removed that.
maybe it's a good idea? just use a branch release/... . when performing release use -DlocalCheckout=true -DpushChanges=false
then create a PR based on the branch release/..
but hey I agree it's complicated ;)

Replies: 2 comments · 3 replies

Comment options

uhm this looks wrong

You must be logged in to vote
0 replies
Comment options

@plamentotev I have removed that.
maybe it's a good idea? just use a branch release/... . when performing release use -DlocalCheckout=true -DpushChanges=false
then create a PR based on the branch release/..
but hey I agree it's complicated ;)

You must be logged in to vote
3 replies
@plamentotev
Comment options

plamentotev Sep 10, 2022
Collaborator Author

Having protected branch makes sense as not allowing force push may safe us from loosing commits. As for the PR requirement it makes some small changes (like bumping the pom version) a bit more tedious to do, but I'm fine with that. I'm just not sure about how to perform the release. One option is make the release from branch different than master and let Maven push it together with the tag. But I'm not sure if the branch name is written somewhere. Probably is indeed safer to use -DpushChanges=false. Does the following makes sense:

  1. Prepare release from master branch with -DpushChanges=false. Push the master branch as release/...
  2. Make PR
  3. Merge the change (after approval from somebody else?)
  4. Push the tag
  5. Pull the new master branch (which is identical as yours as we don't do merges)
  6. Continue from here as normal release (release:perform does not push changes, right?)
@olamy
Comment options

Uhm I wouldn;t use such workflow.

  1. create a branch from master called release/5.1 if releasing 5.1
  2. from this branch mvn release:prepare release:perform -DlocalCheckout=true -DpushChanges=false
  3. push manually the tag
  4. create a PR from the branch release/5.1 to sync release steps and new xx-SNAPSHOT version

makes sense?

@plamentotev
Comment options

plamentotev Sep 13, 2022
Collaborator Author

I did some dry runs. It appears that the release plugin does not use the current branch but rather the scm configuration from the pom. I could be wrong though. Anyway -DpushChanges=false and -DlocalCheckout=true did the trick. Thanks for the help.

Answer selected by plamentotev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.