2929
3030 # Nuget Setup
3131 NUGET_VERSION : ' latest'
32- NUGET_OUTPUT : ' .output/'
32+ NUGET_OUTPUT : ' output'
33+ NUGET_TOKEN : ${{ secrets.NUGET_TOKEN }}
34+ NUGET_FEED : https://api.nuget.org/v3/index.json
3335
3436 steps :
3537 - name : Checkout reference commit
@@ -110,12 +112,32 @@ jobs:
110112 nuget pack "$nuspecFile" `
111113 -Version ${{ env.VERSION }} `
112114 -Properties "Configuration=${{ env.CONFIG }};CopyrightYear=$(Get-Date -Format yyyy)"`
113- -OutputDirectory ${{ env.NUGET_OUTPUT }}
115+ -OutputDirectory ${{ github.workspace }}/${{ env.NUGET_OUTPUT }}
114116 }
115117
116118 - name : Upload build artifact
117119 if : ${{ github.event_name != 'pull_request' }}
118120 uses : actions/upload-artifact@v4
119121 with :
120- name : build_ ${{ env.PROJECT_NAME }}.${{ env.VERSION }}
122+ name : ${{ env.PROJECT_NAME }}.${{ env.VERSION }}
121123 path : ${{ github.workspace }}/${{ env.NUGET_OUTPUT }}
124+
125+ - name : Download build artifact
126+ uses : actions/download-artifact@v4
127+ with :
128+ name : ${{ env.PROJECT_NAME }}.${{ env.VERSION }}
129+ path : ${{ github.workspace }}/${{ env.NUGET_OUTPUT }}
130+
131+ - name : Configure NuGet
132+ uses : nuget/setup-nuget@v2
133+ with :
134+ nuget-version : ${{ env.NUGET_VERSION }}
135+
136+ - name : Push to NuGet Feed
137+ shell : bash
138+ working-directory : ${{ env.NUGET_OUTPUT }}
139+ run : |
140+ for nugetFile in ./*.nupkg
141+ do
142+ nuget push $nugetFile ${{ env.NUGET_TOKEN }} -Source ${{ env.NUGET_FEED }}
143+ done
0 commit comments