semantic-release
semantic-release copied to clipboard
maintained version is not bumped as expected
I'm using the --maintained-version
flag with initial value of 2-rc
/usr/local/bin/semantic-release --provider-opt "slug=<repo-name>" --no-ci -f --allow-no-changes --prerelease --maintained-version "2-rc"
[go-semantic-release]: version: 2.6.0
[go-semantic-release]: ci-condition plugin: [email protected]
[go-semantic-release]: provider plugin: [email protected]
[go-semantic-release]: getting default branch...
[go-semantic-release]: found default branch: master
[go-semantic-release]: repo is private
[go-semantic-release]: found current branch: cd290683f0a83df03051f060ffc9bac993be9159
[go-semantic-release]: found maintained version: 2-rc
[go-semantic-release]: found current sha: cd290683f0a83df03051f060ffc9bac993be9159
[go-semantic-release]: getting latest release...
[go-semantic-release]: found version: 2.0.0-rc
[go-semantic-release]: getting commits...
[go-semantic-release]: commit-analyzer plugin: [email protected]
[go-semantic-release]: calculating new version...
[go-semantic-release]: new version: 2.0.0-rc.1
[go-semantic-release]: generating changelog...
[go-semantic-release]: changelog-generator plugin: [email protected]
[go-semantic-release]: creating release...
[go-semantic-release]: done.
Expected behavior:
The newly created version is 2.1.0-rc
.
Actual behavior:
The newly created version is 2.0.0-rc.1
.
I tried flipping the order and use rc-2
, but that is an illegal format according to the command:
[go-semantic-release]: improper constraint: rc-2
Thanks!
Hi @ido-namely, the maintained version feature is to keep releases in a certain version range. As you pass a version range with a prerelease value (2-rc
), it will stay in the prerelease version range. So the actual behavior is correct.
The behavior you expect would be a different feature to set the prerelease value to a custom value.
Hi @christophwitzko
I have a similar but slightly different issue, In my case, if the tag 1.x.x-rc.1 already exist and when we specify --maintained-version 1.x.x-rc
, then I get an error POST https://gitlab.com/api/v4/projects/25611712/releases: 409 {message: Release already exists}
and the command get terminated with exit code 1.
$ semantic-release --token ${GL_TOKEN} --version-file --allow-no-changes --prerelease --allow-maintained-version-on-default-branch --maintained-version ${CURRENT_TAG}-rc [go-semantic-release]: version: 2.18.0 [go-semantic-release]: ci-condition plugin: GitLab [email protected] [go-semantic-release]: provider plugin: [email protected] [go-semantic-release]: getting default branch... [go-semantic-release]: found default branch: master [go-semantic-release]: repo is private [go-semantic-release]: found current branch: test/CCNG-465 [go-semantic-release]: found maintained version: v1.5.1-rc [go-semantic-release]: found current sha: f6a230ead5fa0c213b807063dd9f3380a2a06424 [go-semantic-release]: running CI condition... [go-semantic-release]: getting latest release... [go-semantic-release]: found version: 1.5.1-rc [go-semantic-release]: getting commits... [go-semantic-release]: analyzing commits... [go-semantic-release]: commit-analyzer plugin: [email protected] [go-semantic-release]: calculating new version... [go-semantic-release]: new version: 1.5.1-rc.1 [go-semantic-release]: generating changelog... [go-semantic-release]: changelog-generator plugin: [email protected] [go-semantic-release]: creating release... [go-semantic-release]: POST https://gitlab.com/api/v4/projects/25611712/releases: 409 {message: Release already exists} [go-semantic-release]: stopping plugins...
I thought the actual behavior was to bump up version from 1.x.x-rc.1
to 1.x.x-rc.2
, however I understand from the previous comment that maintained version will stay as it is.
Is it possible to ignore if the release already exists and pass the command with exit code 0 ?