11name : build and test
22
3- on : [push, pull_request]
3+ on :
4+ push :
5+ branches :
6+ - winrt
7+ pull_request :
8+ branches :
9+ - winrt
10+ workflow_dispatch :
411
512env :
6- DOTNET_VERSION : ' 6 .0.x' # The .NET SDK version to use
13+ DOTNET_VERSION : ' 8 .0.x' # The .NET SDK version to use
714
815jobs :
9- build-and-test :
10-
11- name : build-and-test
16+ build-and-pack :
17+ name : build-and-pack
1218 runs-on : windows-latest
13-
1419 env :
15- Solution_Name : AdvancedSharpAdbClient.WinRT\AdvancedSharpAdbClient.WinRT.csproj
20+ Nuget_Source : https://nuget.pkg.github.com/yungd1plomat
21+ Solution_Name : AdvancedSharpAdbClient.WinRT/AdvancedSharpAdbClient.WinRT.csproj
1622
1723 steps :
18- - uses : actions/checkout@v3
19- - name : Setup .NET Core
24+ - name : Checkout
25+ uses : actions/checkout@v3
26+ with :
27+ fetch-depth : 0
28+
29+ - name : Setup .NET Core App
2030 uses : actions/setup-dotnet@v3
2131 with :
22- dotnet-version : ${{env.DOTNET_VERSION}}
32+ dotnet-version : ${{ env.DOTNET_VERSION }}
33+ dotnet-quality : ' preview'
2334
2435 - name : Setup MSBuild.exe
2536 uses : microsoft/setup-msbuild@v1
2637 with :
2738 msbuild-architecture : x64
2839
29- - name : Install dependencies
30- run : msbuild $env:Solution_Name /t:Restore
31-
32- - name : Build
33- run : msbuild $env:Solution_Name
40+ - name : Setup NuGet.exe
41+ uses : NuGet/setup-nuget@v1
42+
43+ - name : Install Dependencies
44+ run : nuget restore $env:Solution_Name
45+
46+ - name : Build & Pack
47+ run : msbuild $env:Solution_Name /t:Pack /p:Configuration=Release /p:PackageOutputPath=../nugets /p:VersionSuffix=build.${{ github.run_number }}.${{ github.run_attempt }}
48+
49+ - name : Publish
50+ if : ${{ github.event_name == 'push' && github.ref_name == 'winrt' }}
51+ run : dotnet nuget push nugets/**.nupkg --source "$env:Nuget_Source" --skip-duplicate --api-key ${{ secrets.NUGET_KEY }}
52+
53+ - name : Upload
54+ uses : actions/upload-artifact@v3
55+ with :
56+ name : Nuget Package
57+ path : nugets/**
0 commit comments