-
Hey guys, I am trying to introduce GitVersion in our team for the very first time, but unfortunately nobody have any experience, therefore I am kindly asking for help. Our repo in DevOps have main branch locked by policy, we deploy to production from there and it is only possible to push via PR from either a "feature" or a "hotfix" branch.
What I am trying to achieve is the following:
Our Pipeline can build and publish two types of NuGet, production ready from main branch, and test packages from building features branch. Example:
Is this logic correct? I am just trying to find a way to build unique packages since multiple features branch are active at the same time. My GitVersion.yml is as following: assembly-versioning-scheme: MajorMinorPatch
mode: Mainline
branches:
main:
tag: ""
is-mainline: true
increment: none
is-source-branch-for: ['feature', 'hotfix']
feature:
regex: ^features?[/-]
tag: alpha-{BranchName}
increment: Minor
source-branches: ['main', 'master']
hotfix:
regex: ^hotfix(es)?[/-]
tag: beta-{BranchName}
increment: Patch
source-branches: ['main', 'master']
ignore:
sha: []
merge-message-formats: {} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
With both |
Beta Was this translation helpful? Give feedback.
With both
feature/*
andhotfix/*
branches, I don't think you are actually using trunk based development, whichmode: Mainline
is meant for. I would recommend that you stick with the default (mode: ContinuousDelivery
) or to usemode: ContinuousDeployment
instead. You should also only override the configuration keys that deviate from the default. I would therefore recommend that you deleteGitVersion.yml
and start fresh and only add overrides where you actually need it.