Skip to content

Commit d69f95e

Browse files
amnd pipeline.
1 parent a6a8e88 commit d69f95e

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

.github/workflows/dotnet-desktop.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,37 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- name: Checkout code
15+
uses: actions/checkout@v4
1516

1617
- name: Setup .NET
1718
uses: actions/setup-dotnet@v4
1819
with:
1920
dotnet-version: 9.0.x
2021

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
2324

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 }}
2630

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
2933

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
3236

33-
- name: Upload a Build Artifact
37+
- name: Upload Build Artifact
3438
uses: actions/upload-artifact@v4
3539
with:
36-
name: ChristopherBriddock.SortingAlgorithms
37-
path: src/ChristopherBriddock.SortingAlgorithms/bin/Release/net9.0/publish
40+
name: nuget-package
41+
path: out/*.nupkg
3842
if-no-files-found: error
3943

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
4246
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)