Skip to content

Commit dc5b9f1

Browse files
this commit removes base_version input and integrate gitversion for semantic versioning
1 parent 7c7b657 commit dc5b9f1

2 files changed

Lines changed: 10 additions & 17 deletions

File tree

.github/workflows/publish-package-pipeline.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
with:
4141
working_directory: Packages/Federation.Sdk/Source
4242
dotnet_version: 9.0.x
43-
base_version: "1.0"
4443
secrets: inherit
4544

4645
# publish this package if there are changes in the corresponding path
@@ -51,5 +50,4 @@ jobs:
5150
with:
5251
working_directory: Packages/Federation.Sdk.Contracts/Source
5352
dotnet_version: 9.0.x
54-
base_version: "1.0"
5553
secrets: inherit

.github/workflows/template-publish-package.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ on:
1414
type: string
1515
default: 9.0.x
1616

17-
base_version:
18-
description: base semantic version
19-
required: false
20-
type: string
21-
default: "1.0"
22-
2317
publish_package:
2418
description: if false, runs restore/build/pack without pushing
2519
required: false
@@ -38,6 +32,15 @@ jobs:
3832
working-directory: ${{ inputs.working_directory }}
3933

4034
steps:
35+
- name: setup gitversion
36+
uses: gittools/actions/gitversion/setup@v0
37+
with:
38+
versionSpec: '5.x'
39+
40+
- name: semantic versioning
41+
uses: gittools/actions/gitversion/execute@v0
42+
id: gitversion
43+
4144
- name: checkout code
4245
uses: actions/checkout@v5
4346

@@ -57,18 +60,10 @@ jobs:
5760

5861
- name: set version and pack
5962
id: pack
60-
env:
61-
BASE_VERSION: ${{ inputs.base_version }}
6263
run: |
63-
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then
64-
VERSION="${BASE_VERSION}.${GITHUB_RUN_NUMBER}"
65-
else
66-
VERSION="${BASE_VERSION}-beta.${GITHUB_RUN_NUMBER}"
67-
fi
68-
64+
VERSION="${{ steps.gitversion.outputs.semVer }}"
6965
echo "use version: $VERSION"
7066
dotnet pack -c Release -p:PackageVersion=$VERSION -o ./output --no-build
71-
7267
echo "package_version=$VERSION" >> $GITHUB_OUTPUT
7368
7469
- name: push package to nuget

0 commit comments

Comments
 (0)