Main/release branch always adds a prerelease tag. #4180
Replies: 5 comments 6 replies
-
I added a comment on #4175 but I realized that it probably wouldn't get looked at as the issue is closed. Sorry about that. |
Beta Was this translation helpful? Give feedback.
-
@toadicusrex the solution from #4175 worked for me it does increase the version if you incremented it with the right commit message. But i use the main branch as release branch |
Beta Was this translation helpful? Give feedback.
-
@HHobeck Would you be willing to accept a PR that adds a property to branch configuration that toggles whether to prevent adding a prerelease tag? Tilusch's answer doesn't give me a solution, I'm willing to do a PR but I don't want to step on toes. |
Beta Was this translation helpful? Give feedback.
-
For me it is absolutely not clear what you are trying to achieve and if I'm honest this issue confusing me very much. I don't see a conceptual deficit at the moment. Before extending the configuration I would recommend you to start with the supported GitFlow (see Link[1]) or GitHubFlow (see Link[2]) workflow. Anyway if you don't want a pre-release version number please use the If you are referring to the previous usage of You can use the experimental TrunkBased workflow instead. Cheers. Link[1]: GitFlow Examples |
Beta Was this translation helpful? Give feedback.
-
This works for me main:
regex: ^main$
mode: ContinuousDelivery
label: ''
increment: Patch
prevent-increment:
of-merged-branch: true
track-merge-target: false
source-branches: []
tracks-release-branches: false
is-release-branch: false
is-main-branch: true
pre-release-weight: 55000
release:
regex: ^release[/-]
mode: ContinuousDelivery
label: ''
increment: Patch
prevent-increment:
when-current-commit-tagged: true
track-merge-target: false
source-branches: ['main']
tracks-release-branches: false
is-release-branch: true
is-main-branch: false
pre-release-weight: 55000 When I want to release a commit from the release branch I tag the commit and get a version number without a pre-release suffix. before tag - {
"AssemblySemFileVer": "0.64.6.1",
"AssemblySemVer": "0.64.6.1",
"BranchName": "release/0.64",
"BuildMetaData": null,
"CommitDate": "2024-12-02",
"CommitsSinceVersionSource": 1,
"EscapedBranchName": "release-0-64",
"FullBuildMetaData": "Branch.release-0.64.Sha.ee4b77cd879c37181ef092443ee1737dcc0c59d7",
"FullSemVer": "0.64.6-1",
"InformationalVersion": "0.64.6-1+Branch.release-0.64.Sha.ee4b77cd879c37181ef092443ee1737dcc0c59d7",
"Major": 0,
"MajorMinorPatch": "0.64.6",
"Minor": 64,
"Patch": 6,
"PreReleaseLabel": "",
"PreReleaseLabelWithDash": "",
"PreReleaseNumber": 1,
"PreReleaseTag": "1",
"PreReleaseTagWithDash": "-1",
"SemVer": "0.64.6-1",
"Sha": "ee4b77cd879c37181ef092443ee1737dcc0c59d7",
"ShortSha": "ee4b77c",
"UncommittedChanges": 9,
"VersionSourceSha": "783974f7e58b8f00ebff18c87b898057c1b7762e",
"WeightedPreReleaseNumber": 55001
}
{
"AssemblySemFileVer": "0.64.6.0",
"AssemblySemVer": "0.64.6.0",
"BranchName": "release/0.64",
"BuildMetaData": null,
"CommitDate": "2024-12-02",
"CommitsSinceVersionSource": 0,
"EscapedBranchName": "release-0-64",
"FullBuildMetaData": "Branch.release-0.64.Sha.ee4b77cd879c37181ef092443ee1737dcc0c59d7",
"FullSemVer": "0.64.6",
"InformationalVersion": "0.64.6+Branch.release-0.64.Sha.ee4b77cd879c37181ef092443ee1737dcc0c59d7",
"Major": 0,
"MajorMinorPatch": "0.64.6",
"Minor": 64,
"Patch": 6,
"PreReleaseLabel": "",
"PreReleaseLabelWithDash": "",
"PreReleaseNumber": null,
"PreReleaseTag": "",
"PreReleaseTagWithDash": "",
"SemVer": "0.64.6",
"Sha": "ee4b77cd879c37181ef092443ee1737dcc0c59d7",
"ShortSha": "ee4b77c",
"UncommittedChanges": 9,
"VersionSourceSha": "ee4b77cd879c37181ef092443ee1737dcc0c59d7",
"WeightedPreReleaseNumber": 60000
} |
Beta Was this translation helpful? Give feedback.
-
Prerequisites
GitVersion package
GitVersion.Tool
GitVersion version
6.0.2
Operating system
Linux, Windows
What are you seeing?
I have tried a crazy number of combinations, but my main branch which should never have prerelease tags is adding prerelease tags every time I commit, unless I also manually commit a version tag (i.e. "v3.5.0"), which it then uses to create a tag like "3.5.0" on the same commit. I grant that this might have something to do with my setup but it behaves the same in both Azure Devops as well as GitHub Actions, and on my own development machine. This worked with version 5.x of GitVersion, but now I've upgraded and I'm hoping to find a quick solution so that my main branch pipeline runs produce release tags without manual intervention (manually adding a release tag). This is related to #4175 I think.
What is expected?
Release branches don't produce gitversion values with prerelease tags. All other branches should build tags with prerelease tags, and they should version based only on version tags and/or commit messages in their direct ancestry (i.e. should not pull highest build version from main unless that version tag is in the same direct ancestry).
Note that I want ContinuousDelivery, not ContinuousDeployment. I want a new version on every commit to master/main, I just want it to not have prerelease tags.
I'm going to try to do a PR if I can figure this out, but I'm hoping I've just made a mistake and I misconfigured it.
Steps to Reproduce
I might be flailing a bit, but here's my config:
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
No response
Beta Was this translation helpful? Give feedback.
All reactions