From 8a9ef2c869e2703f3c5eeb60591e1d1712e19da7 Mon Sep 17 00:00:00 2001 From: Christopher Mann Date: Fri, 31 Jan 2025 18:37:47 +0100 Subject: [PATCH] More fixes --- GitVersion.yml | 4 ++++ azure-pipelines.yml | 5 ++++- src/Directory.Build.targets | 10 +++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index 389b09e..d9ddf88 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,4 +1,8 @@ +# Use GitFlow to get access to support branches workflow: GitFlow/v1 +# Microsoft recommends to only change the major version of assemblies +# to reduce the amount of assembly redirect. Use MajorMinor until +# 1.0.0 is released (as 0.x.z to 0.y.0 might contain breaking changes). assembly-versioning-scheme: MajorMinor branches: release: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 074b1f9..891ff31 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,7 +5,10 @@ trigger: - support/* variables: - GIT_BRANCH: ${{ iif(startsWith(variables['Build.SourceBranch'], 'refs/tags'), '', variables['Build.SourceBranch']) }} + # The Azure Pipelines integration of GitVersion normalizes tag names + # incorrectly. Hence, we override it here. + # See https://github.com/GitTools/GitVersion/pull/4400 + GIT_BRANCH: ${{ iif(startsWith(variables['Build.SourceBranch'], 'refs/tags/'), '', variables['Build.SourceBranch']) }} jobs: - job: Build diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 6032f0d..9ec54d4 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,7 +1,15 @@ + - $(GitVersion_FullSemVer.Replace('+','-ci.')) + + $([System.Text.RegularExpressions.Regex]::Replace( + $(GitVersion_FullSemVer), + '^([vV]?\d+\.\d+\.\d+)(-beta\.)(\d+)\+(\d+)', + '$1-0beta.$3.$4')) +