Skip to content

Commit a5e6e3d

Browse files
authored
Actions: support publishing to MyGet off main branch (#2964)
* Actions: support publishing to MyGet off main branch This is on the way to removing AppVeyor (currently broken) from our environment. Publishes to MyGet when building from a push to main, _not_ on pull requests. * Only package on main as well
1 parent 515c47a commit a5e6e3d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,10 @@ jobs:
143143
name: Tests Results - Windows Server 2022
144144
path: 'test-results/*.trx'
145145
reporter: dotnet-trx
146+
# Package and upload to MyGet only on pushes to main, not on PRs
147+
- name: .NET Pack
148+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
149+
run: dotnet pack Build.csproj --no-build -c Release /p:PackageOutputPath=${env:GITHUB_WORKSPACE}\.nupkgs /p:CI=true
150+
- name: Upload to MyGet
151+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
152+
run: dotnet nuget push ${env:GITHUB_WORKSPACE}\.nupkgs\*.nupkg -s https://www.myget.org/F/stackoverflow/api/v2/package -k ${{ secrets.MYGET_API_KEY }}

0 commit comments

Comments
 (0)