Skip to content

Commit ac16215

Browse files
committed
add publish to nuget.org
1 parent 030cdb0 commit ac16215

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

.github/workflows/dotnet-core-desktop.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
strategy:
5252
matrix:
53-
configuration: [Debug, Release]
53+
configuration: [Release, Debug]
5454

5555
runs-on: windows-latest # For a list of available runner types, refer to
5656
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
@@ -74,14 +74,40 @@ jobs:
7474
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
7575
- name: Setup MSBuild.exe
7676
uses: microsoft/setup-msbuild@2008f912f56e61277eefaac6d1888b750582aa16
77-
78-
# Execute all unit tests in the solution
79-
- name: Execute unit tests
80-
run: dotnet test
81-
77+
8278
# Restore the application to populate the obj folder with RuntimeIdentifiers
8379
- name: Restore the application
8480
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
8581
env:
8682
Configuration: ${{ matrix.configuration }}
83+
84+
# Buid the application
85+
- name: Build the application
86+
run: msbuild $env:Solution_Name /t:Rebuild /p:Configuration=$env:Configuration
87+
env:
88+
Configuration: ${{ matrix.configuration }}
89+
# Execute all unit tests in the solution
90+
- name: Execute unit tests
91+
run: dotnet test
8792

93+
# Publish Artifacts
94+
- name: 'Publish Artifacts'
95+
uses: actions/[email protected]
96+
with:
97+
name: 'artifactory'
98+
path: ./Analogy.LogViewer.Serilog/bin/${{ matrix.configuration }}
99+
push-nuget:
100+
name: 'Push NuGet Packages'
101+
needs: build
102+
runs-on: windows-latest
103+
steps:
104+
- name: 'Download Artifact'
105+
uses: actions/download-artifact@v1
106+
with:
107+
name: 'artifactory'
108+
- name: 'Dotnet NuGet Push'
109+
run: |
110+
Get-ChildItem .\artifactory -Filter *.*nupkg |
111+
Where-Object { !$_.Name.Contains('preview') } |
112+
ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} }
113+
shell: pwsh

0 commit comments

Comments
 (0)