Skip to content

Commit

Permalink
GitHub Actions: Clear version suffix when set in project files
Browse files Browse the repository at this point in the history
Using MSBuild property because the `-version-suffix` switch does not accept null or an empty string
  • Loading branch information
bkoelman committed Sep 24, 2023
1 parent 88d7814 commit 091fa28
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ jobs:
- name: Build
shell: pwsh
run: |
if ($env:PACKAGE_VERSION_SUFFIX) {
dotnet build --no-restore --configuration Release --version-suffix=$env:PACKAGE_VERSION_SUFFIX
}
else {
dotnet build --no-restore --configuration Release
}
dotnet build --no-restore --configuration Release /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
- name: Test
run: |
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true" -- RunConfiguration.CollectSourceInformation=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true
Expand All @@ -139,12 +134,7 @@ jobs:
- name: Generate packages
shell: pwsh
run: |
if ($env:PACKAGE_VERSION_SUFFIX) {
dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages --version-suffix=$env:PACKAGE_VERSION_SUFFIX
}
else {
dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages
}
dotnet pack --no-build --configuration Release --output $env:GITHUB_WORKSPACE/artifacts/packages /p:VersionSuffix=$env:PACKAGE_VERSION_SUFFIX
- name: Upload packages to artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 091fa28

Please sign in to comment.