Merge pull request #507 from Microsoft/scripts/download-nugets
Add script to download nugets from release definition
This commit is contained in:
Коммит
80acd3b077
|
@ -0,0 +1,11 @@
|
|||
$basePackage="Microsoft.AppCenter"
|
||||
$version=(Select-String -Path windows/nuspecs/nuget/AppCenter.nuspec -Pattern "version>(.*)<").Matches.Groups[1].Value
|
||||
foreach ($packageSuffix in @("", ".Analytics", ".Crashes", ".Distribute", ".Push")) {
|
||||
$package = "$basePackage$packageSuffix"
|
||||
$url = "https://msmobilecenter.pkgs.visualstudio.com/_apis/packaging/feeds/$env:NUGET_FEED_ID/nuget/packages/$package/versions/$version/content"
|
||||
$password = [System.Text.Encoding]::UTF8.GetBytes("appcenter:$env:NUGET_PASSWORD")
|
||||
$password = [System.Convert]::ToBase64String($password)
|
||||
$webClient = New-Object System.Net.WebClient
|
||||
$webClient.Headers.Add("Authorization","Basic $password")
|
||||
$webClient.DownloadFile($url, "$pwd/$package.$version.nupkg")
|
||||
}
|
Загрузка…
Ссылка в новой задаче