Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GOV-29: Fixing NuGet publishing failing due to GitHub runners now having NuGet.org registered as a package source #324

Merged
merged 6 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/actions/publish-nuget/Add-SourceLinkPackage.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Register NuGet.org as a package source since GitHub runners don't have it by default.
Register-PackageSource -Name NuGet.org -Location https://api.nuget.org/v3/index.json -ProviderName NuGet
# Register NuGet.org as a package source since GitHub runners don't necessarily have it by default.
$existingSource = Get-PackageSource -Name NuGet.org -ErrorAction SilentlyContinue

if (-not $existingSource)
{
Register-PackageSource -Name NuGet.org -Location https://api.nuget.org/v3/index.json -ProviderName NuGet
}
else
{
Write-Output 'Package source for NuGet.org is already registered.'
}
dministro marked this conversation as resolved.
Show resolved Hide resolved

# Get the latest version of the package.
$latestPackage = Find-Package -Name Microsoft.SourceLink.GitHub -Source NuGet.org | Sort-Object Version -Descending | Select-Object -First 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
dotnet-version: ${{ inputs.dotnet-version }}

- name: Publish to NuGet
uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev
uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/GOV-29
with:
source: ${{ inputs.source }}
verbosity: ${{ inputs.verbosity }}
Expand Down
Loading