Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
Fix versioning in workflows (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell authored Feb 17, 2024
1 parent 5f1e12e commit e7ca8e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
Build:
runs-on: ubuntu-latest
env:
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1

steps:
Expand All @@ -40,12 +39,13 @@ jobs:
fetch-depth: 0 # Required for GitVersion

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'

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

Expand All @@ -57,16 +57,17 @@ jobs:
- name: Build & Test
run: >
dotnet test
--configuration $buildConfiguration
--configuration Release
--collect "Code coverage"
- name: Pack
run: >
dotnet pack
--configuration $buildConfiguration
--configuration Release
--no-build
--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 @@ -96,6 +97,6 @@ jobs:

- name: Publish to NuGet.org
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 @@ -23,10 +23,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"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
Expand Down

0 comments on commit e7ca8e7

Please sign in to comment.