From c97a11fc8e5c82649f67a050a206829394fd6e47 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 5 Dec 2023 09:40:22 -0800 Subject: [PATCH] GHA: publish nuget packages to the GitHub Nuget Store This pushes the new nuget packages to the nuget source to ease the distribution for our builds. --- .github/workflows/bcny-ci.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bcny-ci.yml b/.github/workflows/bcny-ci.yml index 36706408e..2a7dd7d0b 100644 --- a/.github/workflows/bcny-ci.yml +++ b/.github/workflows/bcny-ci.yml @@ -92,4 +92,21 @@ jobs: - uses: actions/upload-artifact@v3 with: name: windows-${{ matrix.arch }}.nupkg - path: io.sentry.sentry-native.win.*.0.0.0-*.nupkg + path: io.sentry.sentry-native.win.crashpad.*.nupkg + + - name: Publish NuGet Packages + env: + NUGET_SOURCE_NAME: TheBrowserCompany + NUGET_SOURCE_URL: https://nuget.pkg.github.com/thebrowsercompany/index.json + NUGET_SOURCE_USERNAME: thebrowsercompany-bot2 + NUGET_SOURCE_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }} + run: | + if ((nuget sources List | Select-String "${env:NUGET_SOURCE_NAME}").Count -gt 0) { + nuget sources Remove -Name "${env:NUGET_SOURCE_NAME}" + } + nuget sources Add -Name ${env:NUGET_SOURCE_NAME} -Source ${env:NUGET_SOURCE_URL} -Username ${env:NUGET_SOURCE_USERNAME} -Password ${env:NUGET_SOURCE_PASSWORD} -StorePasswordInClearText + nuget setApiKey ${env:NUGET_API_KEY} -Source ${env:NUGET_SOURCE_URL} + $pkgs = Get-ChildItem -Path io.sentry.sentry-native.win.crashpad.*.nupkg + nuget push $pkgs[0].Name -Source ${env:NUGET_SOURCE_URL} -SkipDuplicate + shell: pwsh