Skip to content

Commit 39a92bd

Browse files
committed
Get list of artifacts from bintray
1 parent ae99a61 commit 39a92bd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

download.build.artifacts.and.package.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@ function Download-Travis-Artifacts($statuses, $downloadLocation) {
9090

9191
$buildNumber = $build.number
9292

93-
ForEach ($platform in @("linux", "osx")) {
94-
$artifactFileName = "binaries-$platform-$buildNumber.zip"
93+
Write-Host -ForegroundColor "Yellow" "Retrieving Bintray version `"$buildNumber`" artifact list"
94+
$files = Invoke-RestMethod-Ex "https://api.bintray.com/packages/libgit2/compiled-binaries/libgit2/versions/$buildNumber/files"
95+
96+
ForEach ($file in $files) {
97+
$artifactFileName = $file.name
9598
$localArtifactPath = "$downloadLocation\$artifactFileName"
9699

97100
Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`""
@@ -127,18 +130,15 @@ Download-Travis-Artifacts $statuses $path
127130
Write-Host -ForegroundColor "Yellow" "Build artifacts have been downloaded at `"$path`""
128131

129132
$package = Get-ChildItem -Path $path -Filter "*.nupkg"
130-
$linuxBins = Get-ChildItem -Path $path -Filter "binaries-linux-*.zip"
131-
$osxBins = Get-ChildItem -Path $path -Filter "binaries-osx-*.zip"
133+
$binaries = Get-ChildItem -Path $path -Filter "*.zip"
132134

133135
Write-Host -ForegroundColor "Yellow" "Extracting build artifacts"
134-
Add-Type -assembly "System.Io.Compression.Filesystem"
135-
[Io.Compression.ZipFile]::ExtractToDirectory("$($package.FullName)", "$($package.FullName).ext")
136-
[Io.Compression.ZipFile]::ExtractToDirectory("$($linuxBins.FullName)", "$($linuxBins.FullName).ext")
137-
[Io.Compression.ZipFile]::ExtractToDirectory("$($osxBins.FullName)", "$($osxBins.FullName).ext")
138-
139-
Write-Host -ForegroundColor "Yellow" "Including non Windows build artifacts"
140-
Move-Item "$($linuxBins.FullName).ext\libgit2\linux-x64\native\*.so" "$($package.FullName).ext\runtimes\linux-x64\native"
141-
Move-Item "$($osxBins.FullName).ext\libgit2\osx\native\*.dylib" "$($package.FullName).ext\runtimes\osx\native"
136+
Add-Type -assembly "System.IO.Compression.Filesystem"
137+
[IO.Compression.ZipFile]::ExtractToDirectory("$($package.FullName)", "$($package.FullName).ext")
138+
139+
ForEach ($binary in $binaries) {
140+
[IO.Compression.ZipFile]::ExtractToDirectory("$($binary.FullName)", "$($package.FullName).ext")
141+
}
142142

143143
Write-Host -ForegroundColor "Yellow" "Building final NuGet package"
144144
Push-location "$($package.FullName).ext"

0 commit comments

Comments
 (0)