@@ -11,33 +11,37 @@ jobs:
11
11
runs-on : ubuntu-latest
12
12
13
13
steps :
14
- - uses : actions/checkout@v4
14
+ - name : Checkout code
15
+ uses : actions/checkout@v4
15
16
16
17
- name : Setup .NET
17
18
uses : actions/setup-dotnet@v4
18
19
with :
19
20
dotnet-version : 9.0.x
20
21
21
- - name : Build & Restore
22
- run : dotnet build --configuration Release src/ChristopherBriddock.SortingAlgorithms.sln -p:PackageVersion= ${{ secrets.RELEASE_VERSION }}
22
+ - name : Add GitHub NuGet Source
23
+ run : dotnet nuget add source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --name github --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
23
24
24
- - name : Test
25
- run : dotnet test --configuration Release src/ChristopherBriddock.SortingAlgorithms.Tests/ChristopherBriddock.SortingAlgorithms.Tests.csproj
25
+ - name : Restore dependencies
26
+ run : dotnet restore src/ChristopherBriddock.SortingAlgorithms.sln
27
+
28
+ - name : Build
29
+ run : dotnet build --configuration Release --no-restore src/ChristopherBriddock.SortingAlgorithms.sln -p:PackageVersion=${{ secrets.RELEASE_VERSION }}
26
30
27
- - name : Publish
28
- run : dotnet publish src/ChristopherBriddock.SortingAlgorithms/ChristopherBriddock.SortingAlgorithms.csproj -c Release -p:PackageVersion=${{ secrets.RELEASE_VERSION }}
31
+ - name : Test
32
+ run : dotnet test --configuration Release --no-build src/ChristopherBriddock.SortingAlgorithms.Tests /ChristopherBriddock.SortingAlgorithms.Tests.csproj
29
33
30
- - name : Create the package
31
- run : dotnet pack --configuration Release src/ChristopherBriddock.SortingAlgorithms/ChristopherBriddock.SortingAlgorithms.csproj -p:PackageVersion=${{ secrets.RELEASE_VERSION }}
34
+ - name : Pack NuGet package
35
+ run : dotnet pack --configuration Release --no-build src/ChristopherBriddock.SortingAlgorithms/ChristopherBriddock.SortingAlgorithms.csproj -p:PackageVersion=${{ secrets.RELEASE_VERSION }} -o out
32
36
33
- - name : Upload a Build Artifact
37
+ - name : Upload Build Artifact
34
38
uses : actions/upload-artifact@v4
35
39
with :
36
- name : ChristopherBriddock.SortingAlgorithms
37
- path : src/ChristopherBriddock.SortingAlgorithms/bin/Release/net9.0/publish
40
+ name : nuget-package
41
+ path : out/*.nupkg
38
42
if-no-files-found : error
39
43
40
- - name : Push to GitHub Packages
41
- run : dotnet nuget push "src/ChristopherBriddock.SortingAlgorithms/bin/Release/ *.nupkg" -k ${{ secrets.GITHUB_TOKEN }} -s "https://nuget.pkg. github.com/${{ github.repository_owner }}/index.json " --skip-duplicate
44
+ - name : Push NuGet package to GitHub Packages
45
+ run : dotnet nuget push "out/ *.nupkg" --source " github" --skip-duplicate
42
46
env :
43
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47
+ NUGET_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments