Skip to content

Commit

Permalink
Merge pull request #324 from Lombiq/issue/GOV-29
Browse files Browse the repository at this point in the history
GOV-29: Fixing NuGet publishing failing due to GitHub runners now having NuGet.org registered as a package source
  • Loading branch information
dministro authored Feb 9, 2024
2 parents 78a0022 + 27086d5 commit 1372540
Showing 1 changed file with 11 additions and 2 deletions.
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.'
}

# 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

0 comments on commit 1372540

Please sign in to comment.