Skip to content

Commit 301186a

Browse files
committed
Get list of artifacts from bintray
1 parent 468e840 commit 301186a

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
@@ -91,8 +91,11 @@ function Download-Travis-Artifacts($statuses, $downloadLocation) {
9191

9292
$buildNumber = $build.number
9393

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

98101
Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`""
@@ -128,18 +131,15 @@ Download-Travis-Artifacts $statuses $path
128131
Write-Host -ForegroundColor "Yellow" "Build artifacts have been downloaded at `"$path`""
129132

130133
$package = Get-ChildItem -Path $path -Filter "*.nupkg"
131-
$linuxBins = Get-ChildItem -Path $path -Filter "binaries-linux-*.zip"
132-
$osxBins = Get-ChildItem -Path $path -Filter "binaries-osx-*.zip"
134+
$binaries = Get-ChildItem -Path $path -Filter "*.zip"
133135

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

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

0 commit comments

Comments
 (0)