Skip to content

Commit ea32721

Browse files
author
Petr Sramek
committed
yguy
1 parent 07b6eb7 commit ea32721

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/dotnet.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
version:
1313
name: Version with GitVersion ${{ vars.GIT_VERSION }}
1414
runs-on: ubuntu-latest
15+
outputs:
16+
SemVer: ${{ steps.gitversion.outputs.fullSemVer }}
1517
steps:
1618
- uses: actions/checkout@v3
1719
with:
@@ -21,26 +23,28 @@ jobs:
2123
with:
2224
versionSpec: ${{ vars.GIT_VERSION }}
2325
preferLatestVersion: true
24-
- name: Update Version with GitVersion ${{ vars.GIT_VERSION }}
26+
- name: Calculate version with GitVersion ${{ vars.GIT_VERSION }}
27+
id: gitversion
2528
uses: gittools/actions/gitversion/execute@v3.1.11
2629
with:
2730
useConfigFile: true
2831
configFilePath: ./.gitversion/version.yml
29-
updateAssemblyInfo: true
3032
- run: 'echo FullSemVer: ${{ env.fullSemVer }}'
3133

3234
build:
3335
name: Build with .NET ${{ vars.DOTNET_VERSION }}
3436
needs: [version]
3537
runs-on: ubuntu-latest
38+
env:
39+
semver: ${{ needs.version.outputs.SemVer }}
3640
steps:
3741
- uses: actions/checkout@v3
3842
- name: Install .NET ${{ vars.DOTNET_VERSION }}
3943
uses: actions/setup-dotnet@v4
4044
with:
4145
dotnet-version: ${{ vars.DOTNET_VERSION }}
4246
- name: Build with .NET ${{ vars.DOTNET_VERSION }}
43-
run: dotnet build ./src/**/*.csproj --configuration ${{ vars.BUILD_CONFIGURATION }} /p:Platform=${{ vars.BUILD_PLATFORM }}
47+
run: dotnet build ./src/**/*.csproj --configuration ${{ vars.BUILD_CONFIGURATION }} /p:Platform=${{ vars.BUILD_PLATFORM }} -p:Version=$env:semver -p:FileVersion=$env:semver
4448
- name: Upload Build
4549
uses: actions/upload-artifact@v4
4650
with:

0 commit comments

Comments
 (0)