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

SNAPSHOT version releaseSnapshotVersion #43

Open
webmutation opened this issue Sep 11, 2024 · 2 comments
Open

SNAPSHOT version releaseSnapshotVersion #43

webmutation opened this issue Sep 11, 2024 · 2 comments

Comments

@webmutation
Copy link

webmutation commented Sep 11, 2024

Does this plugin support gitflow strategies.

In short the ability to merge back changes once a release is done on a specific branch.

Develop used for SNAPSHOT releases, once it is released the changes need to be merged into master.
Once Master does a release, the version is updated and released, this creates new SNAPSHOT version on develop.

I noticed that the plugin can add -SNAPSHOT to versions but it not able to merge back these changes... wondering if there is a plan to do this.

UPDATE: noticed on another issues that releaseSnapshotVersion could be added to this plugin.

There is nothing special needed for this, the release just needs to have -SNAPSHOT in the name and it will be published to the snapshot repository as is indicated in the setting.xml

@webmutation webmutation changed the title Support Gitflow strategies SNAPSHOT version releaseSnapshotVersion Sep 12, 2024
@simonseyock
Copy link
Member

I think merging is something that should be done manually and not automatically. Also this can be achieved via git easily and I think is out of scope for this plugin. How would you handle merge conflicts?

@webmutation
Copy link
Author

webmutation commented Oct 22, 2024

Hi Simon,

Shortly after I posted this comment I saw that there is a plugin that is able to do this @saithodev/semantic-release-backmerge

In essence all that is actually missing is the ability to do SNAPSHOT releases via this plugin to have a proper gitflow setup.

In the gitflow way we use, the main branch or release branch is never commited on, so that there are no merge conflicts created.

feature branch merge to develop -> SNAPSHOT release
develop merge to main -> Release
hotfix is handled as an exception and if backporting needs to be done it is done via a feature branch.

Here is my example config... also would be nice to have the version available in the commit message
"snapshotCommitMessage": "chore(release): Updating SNAPSHOT [skip ci]",
would like to have
"snapshotCommitMessage": "chore(release): Updating ${nextRelease.version} [skip ci]",
however it seems that the variable is not passed into as a parameter to the function.

  "branches": ["main","develop"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",   
    "@semantic-release/changelog",
    [
      "@semantic-release/exec",
      { 
        "verifyReleaseCmd": 'mvn versions:set -DnewVersion="${nextRelease.version}"'
      },
    ],    
    "@semantic-release/gitlab",
    [
      "@terrestris/maven-semantic-release",
      {
        "clean": false,
        "updateSnapshotVersion": true,
        "snapshotCommitMessage": "chore(release): Updating SNAPSHOT [skip ci]",
        "settingsPath": "/builds/apim/cc-tester-backend/.m2/settings.xml",
      }
    ],
    "@semantic-release/git",
      {
      "assets": ["CHANGELOG.md","pom.xml"],
      "message": "chore(release): ${nextRelease.version} [skip ci]",
      },
    [
      "@saithodev/semantic-release-backmerge",
      {
        "backmergeBranches": [{"from": "develop", "to": "main"}],
      }
    ]
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants