Skip to content

Commit

Permalink
Fix versioning in workflows (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell authored Feb 17, 2024
1 parent ab8c683 commit 8805a3e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
Build:
runs-on: ubuntu-latest
env:
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1

steps:
Expand All @@ -32,13 +31,13 @@ jobs:
- name: Build
run: >
dotnet build
--configuration $buildConfiguration
--configuration Release
--no-restore
- name: Test
run: >
dotnet test
--configuration $buildConfiguration
--configuration Release
--no-build
--verbosity normal
--collect "Code coverage"
17 changes: 9 additions & 8 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ on:
default: 'false'

env:
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1

jobs:
Expand All @@ -37,6 +36,7 @@ jobs:

- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
id: gitversion
with:
useConfigFile: true

Expand All @@ -51,25 +51,26 @@ jobs:
- name: Build
run: >
dotnet build
--configuration $buildConfiguration
--configuration Release
--no-restore
- name: Test
run: >
dotnet test
--configuration $buildConfiguration
--configuration Release
--no-build
--verbosity normal
--collect "Code coverage"
- name: Pack
run: >
dotnet pack
--configuration $buildConfiguration
--configuration Release
--no-build
--verbosity Detailed
--output $GITHUB_WORKSPACE/drop
-p:PackageVersion=$GITVERSION_NUGETVERSION
--output ${{ github.workspace }}/drop
-p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
-p:VersionPrefix=${{ steps.gitversion.outputs.nuGetVersion }}
- name: Publish Artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -99,7 +100,7 @@ jobs:
- name: Publish to private feed
# if: startsWith(github.ref, 'refs/tags/')
run: >
dotnet nuget push "$GITHUB_WORKSPACE/drop/*"
dotnet nuget push "${{ github.workspace }}/drop/*"
-k ${{ secrets.PRIVATE_FEED_API_KEY }}
--skip-duplicate
Expand All @@ -125,6 +126,6 @@ jobs:
- name: Publish to NuGet.org
# if: startsWith(github.ref, 'refs/tags/')
run: >
dotnet nuget push "$GITHUB_WORKSPACE/drop/*"
dotnet nuget push "${{ github.workspace }}/drop/*"
-k ${{ secrets.NUGET_API_KEY }}
--skip-duplicate
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
Build:
runs-on: ubuntu-latest
env:
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1

steps:
Expand All @@ -32,6 +31,7 @@ jobs:

- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
id: gitversion
with:
useConfigFile: true

Expand All @@ -49,25 +49,26 @@ jobs:
- name: Build
run: >
dotnet build
--configuration $buildConfiguration
--configuration Release
--no-restore
- name: Test
run: >
dotnet test
--configuration $buildConfiguration
--configuration Release
--no-build
--verbosity normal
--collect "Code coverage"
- name: Pack
run: >
dotnet pack
--configuration $buildConfiguration
--configuration Release
--no-build
--verbosity Detailed
--output $GITHUB_WORKSPACE/drop
-p:PackageVersion=$GITVERSION_NUGETVERSION
--output ${{ github.workspace }}/drop
-p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
-p:VersionPrefix=${{ steps.gitversion.outputs.nuGetVersion }}
- name: Publish Artifact
uses: actions/upload-artifact@v4
Expand All @@ -78,6 +79,6 @@ jobs:
- name: Publish to NuGet.org
if: startsWith(github.ref, 'refs/tags/')
run: >
dotnet nuget push "$GITHUB_WORKSPACE/drop/*"
dotnet nuget push "${{ github.workspace }}/drop/*"
-k ${{ secrets.NUGET_API_KEY }}
--skip-duplicate
4 changes: 0 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<PropertyGroup>
<VersionPrefix Condition="'$(GITVERSION_NUGETVERSION)' != ''">$(GITVERSION_NUGETVERSION)</VersionPrefix>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="5.0.0.1" PrivateAssets="All"/>
</ItemGroup>
Expand Down

0 comments on commit 8805a3e

Please sign in to comment.