Skip to content

Commit

Permalink
Changed the cicd to restore, build, and publish in one step
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronMayne committed Sep 13, 2023
1 parent 4c4e2dc commit f341268
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
SourceDir: ./src/
Configuration: Release
Solution_Path: ./src/Extended.Collections.sln
# MSBuild defaults
NoBuild: true # Build once explictly
NoRestore: true # Restore once explictly
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -23,14 +26,14 @@ jobs:
- name: Restore Dotnet Tools
run: dotnet tool restore
- name: Run Git Version
run: |
dotnet gitversion
echo Semantic Version: ${GitVersion_SemVer}
run: dotnet gitversion
- name: Restore
run: dotnet restore ${Solution_Path} -p:NoRestore=false
- name: Build
run: dotnet build ${Solution_Path}
run: dotnet build ${Solution_Path} -p:Version=${GitVersion_AssemblySemVer} -p:NoBuild=false
- name: Execute unit tests
run: dotnet test ${Solution_Path}
run: dotnet test ${Solution_Path}
- name: Pack
run: dotnet msbuild -t:pack ${Solution_Path}
run: dotnet msbuild -t:pack ${Solution_Path} -p:PackageVersion={GitVersion_NuGetVersion}
- name: Push
run: dotnet nuget push ./src/Extended.Collections/bin/${Configuration}/*.nupkg --api-key ${{ secrets.NuGet_Api_Key }} --source ${{ vars.Nuget_Source_Url}}
run: dotnet nuget push ./src/Extended.Collections/bin/${Configuration}/*.nupkg --skip-duplicate --api-key ${{ secrets.NuGet_Api_Key }} --source ${{ vars.Nuget_Source_Url}}

0 comments on commit f341268

Please sign in to comment.