-
Hi All, I have a question that I was wondering if anyone could help me with. I'm attempting to cut a production/stable release with GitVersion, but the release always seems to include the My configuration: mode: ContinuousDelivery
version-in-branch-pattern: (?<version>[vV]?\d+(\.\d+)?(\.\d+)?).*
major-version-bump-message: "(\+semver:\s?(breaking|major))"
minor-version-bump-message: "(\+semver:\s?(feature|minor))"
patch-version-bump-message: "(\+semver:\s?(fix|patch))"
no-bump-message: '\+semver:\s?(none|skip)'
commit-message-incrementing: MergeMessageOnly
branches:
main:
regex: ^master$|^main$|^dev(elop)?(ment)?$
source-branches: [ 'release' ]
label: alpha
is-mainline: true
tracks-release-branches: true
pre-release-weight: 0
release:
regex: ^releases?[/-]
label: beta
increment: None
prevent-increment-of-merged-branch-version: true
track-merge-target: false
source-branches: [ 'main', 'release' ]
tracks-release-branches: false
is-release-branch: true
is-mainline: false
pre-release-weight: 30000
testing:
regex: ^testing$
source-branches: [ 'release' ]
label: beta
is-mainline: true
tracks-release-branches: true
track-merge-target: true
pre-release-weight: 30000
staging:
regex: ^staging$
source-branches: [ 'release' ]
label: rc
is-mainline: true
tracks-release-branches: true
track-merge-target: true
pre-release-weight: 30000
production:
regex: ^production$
source-branches: [ 'release' ]
label: ''
is-mainline: true
tracks-release-branches: true
track-merge-target: true
pre-release-weight: 30000 Basic Flow:
Would anyone know how to get Edit: Forgot to mention that I'm using GitVersion |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You mean this? [Test]
public void __Just_A_Test__()
{
var configuration = GitHubFlowConfigurationBuilder.New.WithLabel(null)
.WithBranch("main", _ => _.WithVersioningMode(VersioningMode.ContinuousDeployment).WithLabel(null))
.Build();
using var fixture = new EmptyRepositoryFixture("main");
fixture.MakeATaggedCommit("1.0.0");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("1.0.1", configuration);
} Please see the following integration test: |
Beta Was this translation helpful? Give feedback.
I'm actually not sure if you are extending/inheriting from the
GitHubFlow/v1
workflow or specifying a complete new workflow. If the second case is true you should define the workflow property to an empty stringworkflow: ''
to have no base configuration.Anyway in your scenario you could of course define a new branch configuration with the name production. Because the label is set to an empty string you get a pre-release with an empty label. If you set it to null you will get no pre-release versions.
Edit: Empty and null strings have a different meaning here.
Edit: If you want to reuse the configuration of main you can do this by just changing the
regex
property: