Skip to content

Commit 1c02ca4

Browse files
committed
Optimizes NuGet publish workflow
Refines the NuGet publish workflow by: - Restoring and building dependencies for individual core projects instead of the entire solution - Improves build times and focuses on necessary components
1 parent a39c4d6 commit 1c02ca4

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/nuget-publish.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,21 @@ jobs:
4040
echo "Version: ${{ steps.gitversion.outputs.semVer }}"
4141
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
4242
43-
- name: Restore dependencies
44-
run: dotnet restore EightBot.Orbit.sln
43+
- name: Restore dependencies for core projects
44+
run: |
45+
dotnet restore EightBot.Orbit.Core/EightBot.Orbit.Core.csproj
46+
dotnet restore EightBot.Orbit.Client/EightBot.Orbit.Client.csproj
47+
dotnet restore EightBot.Orbit.Server/EightBot.Orbit.Server.csproj
48+
dotnet restore EightBot.Orbit.Server.Web/EightBot.Orbit.Server.Web.csproj
49+
dotnet restore EightBot.Orbit.Tests/EightBot.Orbit.Tests.csproj
4550
46-
- name: Build solution
47-
run: dotnet build EightBot.Orbit.sln --configuration Release --no-restore /p:Version=${{ steps.gitversion.outputs.assemblySemVer }} /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
51+
- name: Build core projects
52+
run: |
53+
dotnet build EightBot.Orbit.Core/EightBot.Orbit.Core.csproj --configuration Release --no-restore /p:Version=${{ steps.gitversion.outputs.assemblySemVer }} /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
54+
dotnet build EightBot.Orbit.Client/EightBot.Orbit.Client.csproj --configuration Release --no-restore /p:Version=${{ steps.gitversion.outputs.assemblySemVer }} /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
55+
dotnet build EightBot.Orbit.Server/EightBot.Orbit.Server.csproj --configuration Release --no-restore /p:Version=${{ steps.gitversion.outputs.assemblySemVer }} /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
56+
dotnet build EightBot.Orbit.Server.Web/EightBot.Orbit.Server.Web.csproj --configuration Release --no-restore /p:Version=${{ steps.gitversion.outputs.assemblySemVer }} /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
57+
dotnet build EightBot.Orbit.Tests/EightBot.Orbit.Tests.csproj --configuration Release --no-restore
4858
4959
- name: Run tests
5060
run: dotnet test EightBot.Orbit.Tests/EightBot.Orbit.Tests.csproj --configuration Release --no-build --verbosity normal

0 commit comments

Comments
 (0)