Skip to content

Commit 8815462

Browse files
authored
Enhance versioning in build workflow
Add branch name to versioning for non-main branches
1 parent d09c0e6 commit 8815462

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/build-workflow.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ jobs:
6262
run: |
6363
dotnet tool install --global minver-cli --version 6.0.0
6464
version=$(minver --tag-prefix v --default-pre-release-identifiers preview.${GIT_BRANCH_SUFFIX}0)
65+
66+
# If on a non-main branch, insert branch name into version
67+
if [ -n "$GIT_BRANCH_SUFFIX" ]; then
68+
version=$(echo "$version" | sed -E "s/^([0-9]+\.[0-9]+\.[0-9]+-[^.]+\.[^.]+)\./\1.${GIT_BRANCH_SUFFIX}/")
69+
fi
70+
6571
echo "MINVERVERSIONOVERRIDE=$version" >> $GITHUB_ENV
6672
echo "### Version: $version" >> $GITHUB_STEP_SUMMARY
6773
- name: Set Default Solution

0 commit comments

Comments
 (0)