Skip to content

Commit 3b4c3ae

Browse files
committed
Changed the workflow files to use gitversion and semantic versioning depending on the branch
1 parent fd1a8b2 commit 3b4c3ae

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

.github/workflows/Gitflow.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,20 @@ jobs:
3131
- name: Checkout code
3232
uses: actions/checkout@v4
3333

34+
- name: Install GitVersion
35+
run: |
36+
dotnet tool install --global GitVersion.Tool --version 5.*
37+
export PATH="$PATH:/home/runner/.dotnet/tools"
38+
39+
- name: Generate a version
40+
id: gitversion
41+
run: |
42+
export GITVERSION_FULLSEMVER=$(gitversion /showvariable FullSemVer)
43+
echo "GIT_TAG=${GITVERSION_FULLSEMVER}" >> $GITHUB_ENV
44+
3445
- name: Create release tag
3546
env:
36-
GIT_TAG: "v$(date +'%Y.%m.%d.%H%M')"
47+
GIT_TAG: ${{ env.GIT_TAG }}
3748
run: |
3849
git config user.name "github-actions[bot]"
3950
git config user.email "github-actions[bot]@users.noreply.github.com"

.github/workflows/trunk.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Trunk CI
32

43
on:
@@ -32,9 +31,20 @@ jobs:
3231
- name: Checkout code
3332
uses: actions/checkout@v4
3433

34+
- name: Install GitVersion
35+
run: |
36+
dotnet tool install --global GitVersion.Tool --version 5.*
37+
export PATH="$PATH:/home/runner/.dotnet/tools"
38+
39+
- name: Generate a version
40+
id: gitversion
41+
run: |
42+
export GITVERSION_FULLSEMVER=$(gitversion /showvariable FullSemVer)
43+
echo "GIT_TAG=${GITVERSION_FULLSEMVER}" >> $GITHUB_ENV
44+
3545
- name: Create release tag
3646
env:
37-
GIT_TAG: "v$(date +'%Y.%m.%d.%H%M')"
47+
GIT_TAG: ${{ env.GIT_TAG }}
3848
run: |
3949
git config user.name "github-actions[bot]"
4050
git config user.email "github-actions[bot]@users.noreply.github.com"

0 commit comments

Comments
 (0)