Closed jeraldsm closed 2 years ago
I have a simliar question, I have two branches, main and dev on dev i want maintained version semver i.e develop-v1.0.0-3 and on main normal development versions, i've tried simply adding a .semrelrc with the contents
{
"maintainedVersion": "develop"
}
but got the following error in my ci environment when it ran on my default branch:
running semantic-release...
/home/runner/work/_temp/4cfdf371-917f-4d80-877b-efdb9d3925b4 --version-file --changelog .generated-go-semantic-release-changelog.md --token *** --allow-initial-development-versions --changelog-generator-opt emojis=true
[go-semantic-release]: version: 2.17.0
[go-semantic-release]: ci-condition plugin: GitHub Actions@1.4.0
[go-semantic-release]: provider plugin: GitHub@1.8.0
[go-semantic-release]: getting default branch...
[go-semantic-release]: found default branch: main
[go-semantic-release]: found current branch: main
[go-semantic-release]: maintained version not allowed on default branch
[go-semantic-release]: stopping plugins...
I would expect the build to bump versions the way it always does on main, and not worry about the maintained version unless it matches the branch specified in the .semrel file.
can someone clarify what i'm doing wrong?
Hi @jeraldsm and @KoduIsGreat,
thanks for using semantic-release and raising this issue. You are absolutely right, this is currently not possible and I am happy to add a flag that allows prereleases on the default branch. π
Thanks for the quick response @christophwitzko. Waiting for the new prelease flag :)
@christophwitzko thanks for the quick response, however i think my need is slightly different I just want to beable to create pre-releases on dev and normal releases on main and i had thought maintainedVersion was the way to do that is this the case?
Hi @christophwitzko ,
Do we have an ETC when the pre-release flag will be available on default branch ? Just wanted to plan accordingly :)
Hey @jeraldsm, I just pushed the feature and version v2.18.0 was released.
You can now use the --allow-maintained-version-on-default-branch
flag to disable the default branch check.
Hi,
I wanted to implement, a prerelease tag ( x.x.x-rc.0) for UAT environment and later create main tag (x.x.x) in production environment as a part of cicd pipeline.
I tried using the "--prerelease" flag, but it bumped the version as it would normally and did not create a special pre-release tag, as shown below.
I've also tried the "--maintained-version rc-1" flag for creating an rc tag however this flag only works in non-default branches. I want an rc tag to be created in main (default) branch.
How can I achieve this using this semantic version tool ?