From 569df2a6ba19c220bdbe6e3d0c3d904cd205b22b Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 May 2017 16:48:47 -0400 Subject: [PATCH 01/16] Initial shape of build matrix --- .travis.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ac22cae..bcdd85d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,18 @@ git: language: c -os: - - osx - - linux +matrix: + include: + - os: linux + dist: trusty + sudo: required + env: RID=ubuntu + - os: linux + dist: trusty + sudo: required + env: RID=centos + - os: osx + env: RID=osx branches: only: From 12082a0b7857f0db73d86140d898ffcbc684c90b Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 May 2017 20:27:48 -0400 Subject: [PATCH 02/16] Add docker support --- .travis.yml | 8 +++++--- Dockerfile.centos-x64 | 7 +++++++ build.libgit2.sh | 28 ++++++++++++++-------------- dockerbuild.sh | 9 +++++++++ uploadbinaries.sh | 6 +++--- 5 files changed, 38 insertions(+), 20 deletions(-) create mode 100644 Dockerfile.centos-x64 create mode 100755 dockerbuild.sh diff --git a/.travis.yml b/.travis.yml index bcdd85d0..258b0c16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,11 @@ matrix: - os: linux dist: trusty sudo: required - env: RID=ubuntu + env: RID=ubuntu-x64 - os: linux dist: trusty sudo: required - env: RID=centos + env: RID=centos-x64 - os: osx env: RID=osx @@ -29,6 +29,8 @@ before_install: install: true -script: ./build.libgit2.sh +script: + - if [[ $RID == "osx" ]] || [[ $RID == "ubuntu-x64" ]]; then ./build.libgit2.sh ; fi + - if [[ $RID != "osx" ]] && [[ $RID != "ubuntu-x64" ]]; then ./dockerbuild.sh ; fi after_success: ./uploadbinaries.sh diff --git a/Dockerfile.centos-x64 b/Dockerfile.centos-x64 new file mode 100644 index 00000000..b488f6ba --- /dev/null +++ b/Dockerfile.centos-x64 @@ -0,0 +1,7 @@ +FROM centos:7 +WORKDIR /nativebinaries +COPY . /nativebinaries/ + +RUN yum -y install gcc openssl cmake + +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/build.libgit2.sh b/build.libgit2.sh index 61a6b269..80c6950e 100755 --- a/build.libgit2.sh +++ b/build.libgit2.sh @@ -22,27 +22,27 @@ popd OS=`uname` ARCH=`uname -m` - -PACKAGEPATH="nuget.package/libgit2" -LIBEXT="so" -if [ $OS == "Linux" ]; then - if [ "$ARCH" == "x86_64" ]; then - ARCH="x64" +PACKAGEPATH="nuget.package/runtimes" + +if [[ $RID == "" ]]; then + if [[ $ARCH == "x86_64" ]]; then + RID="unix-x64" + else + RID="unix-x86" fi + echo "$(tput setaf 3)RID not defined. Falling back to '$RID'.$(tput sgr0)" +fi - OSPATH="/linux" - ARCHPATH="-$ARCH" -elif [ $OS == "Darwin" ]; then - OSPATH="/osx" +if [[ $OS == "Darwin" ]]; then LIBEXT="dylib" else - OSPATH="/unix" + LIBEXT="so" fi -rm -rf $PACKAGEPATH$OSPATH -mkdir -p $PACKAGEPATH$OSPATH$ARCHPATH/native +rm -rf $PACKAGEPATH/$RID +mkdir -p $PACKAGEPATH/$RID/native -cp libgit2/build/libgit2-$SHORTSHA.$LIBEXT $PACKAGEPATH$OSPATH$ARCHPATH/native +cp libgit2/build/libgit2-$SHORTSHA.$LIBEXT $PACKAGEPATH/$RID/native exit $? diff --git a/dockerbuild.sh b/dockerbuild.sh new file mode 100755 index 00000000..d3195565 --- /dev/null +++ b/dockerbuild.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +docker build -t $RID -f Dockerfile.$RID . + +docker run -it -e RID=$RID --name=$RID $RID + +docker cp $RID:/nativebinaries/nuget.package/runtimes nuget.package + +docker rm $RID diff --git a/uploadbinaries.sh b/uploadbinaries.sh index 95723a7f..78a0767f 100755 --- a/uploadbinaries.sh +++ b/uploadbinaries.sh @@ -4,13 +4,13 @@ if [ $TRAVIS_SECURE_ENV_VARS == "true" ]; then pushd nuget.package -zip -r binaries.zip libgit2 +zip -r binaries.zip runtimes BINTRAY_API_USER="nulltoken" -curl -T binaries.zip -u$BINTRAY_API_USER:$BINTRAY_API_KEY https://api.bintray.com/content/libgit2/compiled-binaries/$TRAVIS_OS_NAME/$TRAVIS_BUILD_NUMBER/binaries-$TRAVIS_OS_NAME-$TRAVIS_BUILD_NUMBER.zip?publish=1 +curl -T binaries.zip -u$BINTRAY_API_USER:$BINTRAY_API_KEY https://api.bintray.com/content/libgit2/compiled-binaries/$RID/$TRAVIS_BUILD_NUMBER/binaries-$RID-$TRAVIS_BUILD_NUMBER.zip?publish=1 -printf "\n\n-> https://dl.bintray.com/libgit2/compiled-binaries/binaries-%s-%s.zip\n\n" "$TRAVIS_OS_NAME" "$TRAVIS_BUILD_NUMBER" +printf "\n\n-> https://dl.bintray.com/libgit2/compiled-binaries/binaries-%s-%s.zip\n\n" "$RID" "$TRAVIS_BUILD_NUMBER" popd From 543bebb6d3ae9f600e283f61065aca706ee711e9 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 20 May 2017 23:00:16 -0400 Subject: [PATCH 03/16] Remove empty placeholder runtimes folders --- buildpackage.ps1 | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/buildpackage.ps1 b/buildpackage.ps1 index f5ae3434..12fee1ce 100644 --- a/buildpackage.ps1 +++ b/buildpackage.ps1 @@ -8,30 +8,4 @@ $buildDate = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss") $versionSuffix = "" if ($pre.IsPresent) { $versionSuffix = "-pre$BuildDate" } -$projectDirectory = Split-Path $MyInvocation.MyCommand.Path -$x86Directory = Join-Path $projectDirectory "nuget.package\runtimes\win7-x86\native" -$x64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win7-x64\native" -$osxDirectory = Join-Path $projectDirectory "nuget.package\runtimes\osx\native" -$linuxDirectory = Join-Path $projectDirectory "nuget.package\runtimes\linux-x64\native" - -if ( -Not (Test-Path $x86Directory\*.dll) ) -{ - mkdir -fo $x86Directory > $null -} - -if ( -Not (Test-Path $x64Directory\*.dll) ) -{ - mkdir -fo $x64Directory > $null -} - -if ( -Not (Test-Path $osxDirectory\*.dylib) ) -{ - mkdir -fo $osxDirectory > $null -} - -if ( -Not (Test-Path $linuxDirectory\*.so) ) -{ - mkdir -fo $linuxDirectory > $null -} - .\nuget.exe Pack nuget.package\NativeBinaries.nuspec -Version $version$versionSuffix -NoPackageAnalysis From 853030c2e8bd056330c0b053c3b07659833454c0 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sun, 21 May 2017 00:43:21 -0400 Subject: [PATCH 04/16] Format document --- download.build.artifacts.and.package.ps1 | 125 ++++++++++++----------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/download.build.artifacts.and.package.ps1 b/download.build.artifacts.and.package.ps1 index 4406d7dc..12447348 100644 --- a/download.build.artifacts.and.package.ps1 +++ b/download.build.artifacts.and.package.ps1 @@ -1,5 +1,5 @@ Param( - [string]$ref = "master", + [string]$ref = "master", [switch]$verbose = $False ) @@ -9,95 +9,95 @@ $ErrorActionPreference = "Stop" function Invoke-RestMethod-Ex($url, $downloadLocation) { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - $irmParams = @{ - } + $irmParams = @{ + } - Write-Host -ForegroundColor "White" "-> Get $url" + Write-Host -ForegroundColor "White" "-> Get $url" - $proxy = [System.Net.WebRequest]::GetSystemWebProxy() - if ($proxy) { - $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials - $proxyUri = $proxy.GetProxy("$url") + $proxy = [System.Net.WebRequest]::GetSystemWebProxy() + if ($proxy) { + $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials + $proxyUri = $proxy.GetProxy("$url") - if ("$proxyUri" -ne "$url") { - $irmParams.Proxy = "$proxyUri" - $irmParams.ProxyUseDefaultCredentials = $true + if ("$proxyUri" -ne "$url") { + $irmParams.Proxy = "$proxyUri" + $irmParams.ProxyUseDefaultCredentials = $true + } } - } - if ($downloadLocation) { - $irmParams.OutFile = "$downloadLocation" - } + if ($downloadLocation) { + $irmParams.OutFile = "$downloadLocation" + } - $output = Invoke-RestMethod @irmParams -ContentType "application/json" -Method "Get" -Uri "$url" + $output = Invoke-RestMethod @irmParams -ContentType "application/json" -Method "Get" -Uri "$url" - if ($verbose) { - Write-Host -ForegroundColor "Gray" "output = $(ConvertTo-Json $output)" - } + if ($verbose) { + Write-Host -ForegroundColor "Gray" "output = $(ConvertTo-Json $output)" + } - return $output + return $output } function Extract-BuildIdentifier($statuses, $forContext) { - $status = $statuses | where { $_.context -eq $forContext } | select -First 1 + $status = $statuses | where { $_.context -eq $forContext } | select -First 1 - if (($status -eq $null) -or ("success".CompareTo($status.state) -ne 0)) { - throw "No successful status has been found for context `"$forContext`"." - } + if (($status -eq $null) -or ("success".CompareTo($status.state) -ne 0)) { + throw "No successful status has been found for context `"$forContext`"." + } - $buildNumber = $status.target_url.Split("/")[-1] + $buildNumber = $status.target_url.Split("/")[-1] - return $buildNumber + return $buildNumber } function Download-AppVeyor-Artifacts($statuses, $downloadLocation) { - $prOrBranch = "branch" + $prOrBranch = "branch" - if ($ref.StartsWith("pull/")) { - $prOrBranch = "pr" - } + if ($ref.StartsWith("pull/")) { + $prOrBranch = "pr" + } - $buildIdentifier = Extract-BuildIdentifier $statuses "continuous-integration/appveyor/$prOrBranch" + $buildIdentifier = Extract-BuildIdentifier $statuses "continuous-integration/appveyor/$prOrBranch" - Write-Host -ForegroundColor "Yellow" "Retrieving AppVeyor build `"$buildIdentifier`"" - $build = Invoke-RestMethod-Ex "https://ci.appveyor.com/api/projects/libgit2/libgit2sharp-nativebinaries/build/$buildIdentifier" + Write-Host -ForegroundColor "Yellow" "Retrieving AppVeyor build `"$buildIdentifier`"" + $build = Invoke-RestMethod-Ex "https://ci.appveyor.com/api/projects/libgit2/libgit2sharp-nativebinaries/build/$buildIdentifier" - $jobId = $build.build.jobs[0].jobId + $jobId = $build.build.jobs[0].jobId - Write-Host -ForegroundColor "Yellow" "Retrieving AppVeyor job `"$jobId`" artifacts" - $artifacts = Invoke-RestMethod-Ex "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts" + Write-Host -ForegroundColor "Yellow" "Retrieving AppVeyor job `"$jobId`" artifacts" + $artifacts = Invoke-RestMethod-Ex "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts" - ForEach ($artifact in $artifacts) { - $artifactFileName = $artifacts[0].fileName - $localArtifactPath = "$downloadLocation\$artifactFileName" + ForEach ($artifact in $artifacts) { + $artifactFileName = $artifacts[0].fileName + $localArtifactPath = "$downloadLocation\$artifactFileName" - Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`"" - Invoke-RestMethod-Ex "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/$artifactFileName" $localArtifactPath - } + Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`"" + Invoke-RestMethod-Ex "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/$artifactFileName" $localArtifactPath + } } function Download-Travis-Artifacts($statuses, $downloadLocation) { - $prOrBranch = "push" + $prOrBranch = "push" - if ($ref.StartsWith("pull/")) { - $prOrBranch = "pr" - } + if ($ref.StartsWith("pull/")) { + $prOrBranch = "pr" + } - $buildIdentifier = Extract-BuildIdentifier $statuses "continuous-integration/travis-ci/$prOrBranch" + $buildIdentifier = Extract-BuildIdentifier $statuses "continuous-integration/travis-ci/$prOrBranch" - Write-Host -ForegroundColor "Yellow" "Retrieving Travis build `"$buildIdentifier`"" - $build = Invoke-RestMethod-Ex "https://api.travis-ci.org/builds/$buildIdentifier" + Write-Host -ForegroundColor "Yellow" "Retrieving Travis build `"$buildIdentifier`"" + $build = Invoke-RestMethod-Ex "https://api.travis-ci.org/builds/$buildIdentifier" - $buildNumber = $build.number + $buildNumber = $build.number - ForEach ($platform in @("linux", "osx")) { - $artifactFileName = "binaries-$platform-$buildNumber.zip" - $localArtifactPath = "$downloadLocation\$artifactFileName" + ForEach ($platform in @("linux", "osx")) { + $artifactFileName = "binaries-$platform-$buildNumber.zip" + $localArtifactPath = "$downloadLocation\$artifactFileName" - Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`"" - Invoke-RestMethod-Ex "https://dl.bintray.com/libgit2/compiled-binaries/$artifactFileName" $localArtifactPath - } + Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`"" + Invoke-RestMethod-Ex "https://dl.bintray.com/libgit2/compiled-binaries/$artifactFileName" $localArtifactPath + } } ###################################################### @@ -109,13 +109,14 @@ Write-Host -ForegroundColor "Yellow" "Creating temporary folder at `"$path`"" New-Item "$path" -type Directory > $null if ($ref.StartsWith("pull/")) { - $pr = $ref.Replace("pull/", "") - Write-Host -ForegroundColor "Yellow" "Retrieving pull request information for pull request $pr" + $pr = $ref.Replace("pull/", "") + Write-Host -ForegroundColor "Yellow" "Retrieving pull request information for pull request $pr" - $prData = Invoke-RestMethod-Ex "https://api.github.com/repos/libgit2/libgit2sharp.nativebinaries/pulls/$pr" - $statusesUrl = $prData.statuses_url -} else { - $statusesUrl = "https://api.github.com/repos/libgit2/libgit2sharp.nativebinaries/commits/$ref/statuses" + $prData = Invoke-RestMethod-Ex "https://api.github.com/repos/libgit2/libgit2sharp.nativebinaries/pulls/$pr" + $statusesUrl = $prData.statuses_url +} +else { + $statusesUrl = "https://api.github.com/repos/libgit2/libgit2sharp.nativebinaries/commits/$ref/statuses" } Write-Host -ForegroundColor "Yellow" "Retrieving LibGit2Sharp.NativeBinaries latest CI statuses of `"$ref`"" From 468e84006060b653d784c28a4deb54fdff0ee236 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sun, 21 May 2017 00:51:16 -0400 Subject: [PATCH 05/16] Upload to single 'libgit2' bintray package --- uploadbinaries.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uploadbinaries.sh b/uploadbinaries.sh index 78a0767f..e6eb33aa 100755 --- a/uploadbinaries.sh +++ b/uploadbinaries.sh @@ -8,7 +8,7 @@ zip -r binaries.zip runtimes BINTRAY_API_USER="nulltoken" -curl -T binaries.zip -u$BINTRAY_API_USER:$BINTRAY_API_KEY https://api.bintray.com/content/libgit2/compiled-binaries/$RID/$TRAVIS_BUILD_NUMBER/binaries-$RID-$TRAVIS_BUILD_NUMBER.zip?publish=1 +curl -T binaries.zip -u$BINTRAY_API_USER:$BINTRAY_API_KEY https://api.bintray.com/content/libgit2/compiled-binaries/libgit2/$TRAVIS_BUILD_NUMBER/binaries-$RID-$TRAVIS_BUILD_NUMBER.zip?publish=1 printf "\n\n-> https://dl.bintray.com/libgit2/compiled-binaries/binaries-%s-%s.zip\n\n" "$RID" "$TRAVIS_BUILD_NUMBER" From 301186a830b5cde55fe187736557d4c062259fc2 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sun, 21 May 2017 00:52:39 -0400 Subject: [PATCH 06/16] Get list of artifacts from bintray --- download.build.artifacts.and.package.ps1 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/download.build.artifacts.and.package.ps1 b/download.build.artifacts.and.package.ps1 index 12447348..d9c9b358 100644 --- a/download.build.artifacts.and.package.ps1 +++ b/download.build.artifacts.and.package.ps1 @@ -91,8 +91,11 @@ function Download-Travis-Artifacts($statuses, $downloadLocation) { $buildNumber = $build.number - ForEach ($platform in @("linux", "osx")) { - $artifactFileName = "binaries-$platform-$buildNumber.zip" + Write-Host -ForegroundColor "Yellow" "Retrieving Bintray version `"$buildNumber`" artifact list" + $files = Invoke-RestMethod-Ex "https://api.bintray.com/packages/libgit2/compiled-binaries/libgit2/versions/$buildNumber/files" + + ForEach ($file in $files) { + $artifactFileName = $file.name $localArtifactPath = "$downloadLocation\$artifactFileName" Write-Host -ForegroundColor "Yellow" "Downloading `"$artifactFileName`"" @@ -128,18 +131,15 @@ Download-Travis-Artifacts $statuses $path Write-Host -ForegroundColor "Yellow" "Build artifacts have been downloaded at `"$path`"" $package = Get-ChildItem -Path $path -Filter "*.nupkg" -$linuxBins = Get-ChildItem -Path $path -Filter "binaries-linux-*.zip" -$osxBins = Get-ChildItem -Path $path -Filter "binaries-osx-*.zip" +$binaries = Get-ChildItem -Path $path -Filter "*.zip" Write-Host -ForegroundColor "Yellow" "Extracting build artifacts" -Add-Type -assembly "System.Io.Compression.Filesystem" -[Io.Compression.ZipFile]::ExtractToDirectory("$($package.FullName)", "$($package.FullName).ext") -[Io.Compression.ZipFile]::ExtractToDirectory("$($linuxBins.FullName)", "$($linuxBins.FullName).ext") -[Io.Compression.ZipFile]::ExtractToDirectory("$($osxBins.FullName)", "$($osxBins.FullName).ext") - -Write-Host -ForegroundColor "Yellow" "Including non Windows build artifacts" -Move-Item "$($linuxBins.FullName).ext\libgit2\linux-x64\native\*.so" "$($package.FullName).ext\runtimes\linux-x64\native" -Move-Item "$($osxBins.FullName).ext\libgit2\osx\native\*.dylib" "$($package.FullName).ext\runtimes\osx\native" +Add-Type -assembly "System.IO.Compression.Filesystem" +[IO.Compression.ZipFile]::ExtractToDirectory("$($package.FullName)", "$($package.FullName).ext") + +ForEach ($binary in $binaries) { + [IO.Compression.ZipFile]::ExtractToDirectory("$($binary.FullName)", "$($package.FullName).ext") +} Write-Host -ForegroundColor "Yellow" "Building final NuGet package" Push-location "$($package.FullName).ext" From 78dd427ac2c931d66ac837e79385b71fabf53bb3 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sun, 21 May 2017 01:05:21 -0400 Subject: [PATCH 07/16] Update props and config file for new RIDs --- UpdateLibgit2ToSha.ps1 | 10 +++++++--- .../build/net461/LibGit2Sharp.NativeBinaries.props | 8 ++++++-- nuget.package/libgit2/LibGit2Sharp.dll.config | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1 index 72802528..bb23e448 100644 --- a/UpdateLibgit2ToSha.ps1 +++ b/UpdateLibgit2ToSha.ps1 @@ -132,8 +132,12 @@ Push-Location $libgit2Directory lib\osx\lib$binaryFilename.dylib PreserveNewest - - lib\linux\x86_64\lib$binaryFilename.so + + lib\ubuntu-x64\lib$binaryFilename.so + PreserveNewest + + + lib\centos-x64\lib$binaryFilename.so PreserveNewest @@ -148,7 +152,7 @@ Push-Location $libgit2Directory $dllConfig = @" - + "@ diff --git a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props index d1bbe3ea..a9664a3d 100644 --- a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props +++ b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props @@ -26,8 +26,12 @@ lib\osx\libgit2-6311e88.dylib PreserveNewest - - lib\linux\x86_64\libgit2-6311e88.so + + lib\ubuntu-x64\libgit2-6311e88.so + PreserveNewest + + + lib\centos-x64\libgit2-6311e88.so PreserveNewest diff --git a/nuget.package/libgit2/LibGit2Sharp.dll.config b/nuget.package/libgit2/LibGit2Sharp.dll.config index ac208153..39d0f548 100644 --- a/nuget.package/libgit2/LibGit2Sharp.dll.config +++ b/nuget.package/libgit2/LibGit2Sharp.dll.config @@ -1,4 +1,4 @@  - + From d706ab202a3dbd337c6b50e8be6edb118813832d Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 21 Apr 2018 16:17:45 -0400 Subject: [PATCH 08/16] Revert to linux-x64 as default RID --- .travis.yml | 6 +++--- UpdateLibgit2ToSha.ps1 | 6 +++--- nuget.package/build/LibGit2Sharp.NativeBinaries.props | 2 +- .../build/net461/LibGit2Sharp.NativeBinaries.props | 6 +++--- nuget.package/libgit2/LibGit2Sharp.dll.config | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 258b0c16..7daf317b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ matrix: - os: linux dist: trusty sudo: required - env: RID=ubuntu-x64 + env: RID=linux-x64 - os: linux dist: trusty sudo: required @@ -30,7 +30,7 @@ before_install: install: true script: - - if [[ $RID == "osx" ]] || [[ $RID == "ubuntu-x64" ]]; then ./build.libgit2.sh ; fi - - if [[ $RID != "osx" ]] && [[ $RID != "ubuntu-x64" ]]; then ./dockerbuild.sh ; fi + - if [[ $RID == "osx" ]] || [[ $RID == "linux-x64" ]]; then ./build.libgit2.sh ; fi + - if [[ $RID != "osx" ]] && [[ $RID != "linux-x64" ]]; then ./dockerbuild.sh ; fi after_success: ./uploadbinaries.sh diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1 index bb23e448..085b8aca 100644 --- a/UpdateLibgit2ToSha.ps1 +++ b/UpdateLibgit2ToSha.ps1 @@ -132,8 +132,8 @@ Push-Location $libgit2Directory lib\osx\lib$binaryFilename.dylib PreserveNewest - - lib\ubuntu-x64\lib$binaryFilename.so + + lib\linux-x64\lib$binaryFilename.so PreserveNewest @@ -152,7 +152,7 @@ Push-Location $libgit2Directory $dllConfig = @" - + "@ diff --git a/nuget.package/build/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/LibGit2Sharp.NativeBinaries.props index ee6b4ce3..d8637808 100644 --- a/nuget.package/build/LibGit2Sharp.NativeBinaries.props +++ b/nuget.package/build/LibGit2Sharp.NativeBinaries.props @@ -1,4 +1,4 @@ - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) $(MSBuildThisFileFullPath) diff --git a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props index a9664a3d..fe4ffefe 100644 --- a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props +++ b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props @@ -1,4 +1,4 @@ - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) $(MSBuildThisFileFullPath) @@ -26,8 +26,8 @@ lib\osx\libgit2-6311e88.dylib PreserveNewest - - lib\ubuntu-x64\libgit2-6311e88.so + + lib\linux-x64\libgit2-6311e88.so PreserveNewest diff --git a/nuget.package/libgit2/LibGit2Sharp.dll.config b/nuget.package/libgit2/LibGit2Sharp.dll.config index 39d0f548..59f111aa 100644 --- a/nuget.package/libgit2/LibGit2Sharp.dll.config +++ b/nuget.package/libgit2/LibGit2Sharp.dll.config @@ -1,4 +1,4 @@ - - + + From e4915232b3970fffe4f76032e008712dc8ceb15b Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 21 Apr 2018 16:20:23 -0400 Subject: [PATCH 09/16] Rename centos-x6 to rhel-x64 --- .travis.yml | 2 +- Dockerfile.centos-x64 => Dockerfile.rhel-x64 | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Dockerfile.centos-x64 => Dockerfile.rhel-x64 (100%) diff --git a/.travis.yml b/.travis.yml index 7daf317b..baf84bdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: - os: linux dist: trusty sudo: required - env: RID=centos-x64 + env: RID=rhel-x64 - os: osx env: RID=osx diff --git a/Dockerfile.centos-x64 b/Dockerfile.rhel-x64 similarity index 100% rename from Dockerfile.centos-x64 rename to Dockerfile.rhel-x64 From df26918566fa4537385616139dbef48b70fff322 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 21 Apr 2018 16:31:52 -0400 Subject: [PATCH 10/16] Add stubs for debian and fedora --- .travis.yml | 8 ++++++++ Dockerfile.debian.9-x64 | 7 +++++++ Dockerfile.fedora-x64 | 7 +++++++ 3 files changed, 22 insertions(+) create mode 100644 Dockerfile.debian.9-x64 create mode 100644 Dockerfile.fedora-x64 diff --git a/.travis.yml b/.travis.yml index baf84bdc..ac3a3808 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,14 @@ matrix: dist: trusty sudo: required env: RID=rhel-x64 + - os: linux + dist: trusty + sudo: required + env: RID=fedora-x64 + - os: linux + dist: trusty + sudo: required + env: RID=debian.9-x64 - os: osx env: RID=osx diff --git a/Dockerfile.debian.9-x64 b/Dockerfile.debian.9-x64 new file mode 100644 index 00000000..18c0e264 --- /dev/null +++ b/Dockerfile.debian.9-x64 @@ -0,0 +1,7 @@ +FROM debian:9 +WORKDIR /nativebinaries +COPY . /nativebinaries/ + +# RUN yum -y install gcc openssl cmake + +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] diff --git a/Dockerfile.fedora-x64 b/Dockerfile.fedora-x64 new file mode 100644 index 00000000..45732d8d --- /dev/null +++ b/Dockerfile.fedora-x64 @@ -0,0 +1,7 @@ +FROM fedora:26 +WORKDIR /nativebinaries +COPY . /nativebinaries/ + +# RUN yum -y install gcc openssl cmake + +CMD ["/bin/bash", "-c", "./build.libgit2.sh"] From c3cf4f73255b87ae0d67dd3297844bca05071d3c Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 21 Apr 2018 17:22:58 -0400 Subject: [PATCH 11/16] Update debian dev dependencies --- Dockerfile.debian.9-x64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.debian.9-x64 b/Dockerfile.debian.9-x64 index 18c0e264..1d45f939 100644 --- a/Dockerfile.debian.9-x64 +++ b/Dockerfile.debian.9-x64 @@ -2,6 +2,6 @@ FROM debian:9 WORKDIR /nativebinaries COPY . /nativebinaries/ -# RUN yum -y install gcc openssl cmake +RUN apt update && apt -y install cmake gcc libcurl4-openssl-dev libssl-dev pkg-config zlib1g-dev CMD ["/bin/bash", "-c", "./build.libgit2.sh"] From 843ab64877dfed43877714db748384877dad8c63 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 21 Apr 2018 17:52:48 -0400 Subject: [PATCH 12/16] Update rhel dev dependencies --- Dockerfile.rhel-x64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.rhel-x64 b/Dockerfile.rhel-x64 index b488f6ba..332752d2 100644 --- a/Dockerfile.rhel-x64 +++ b/Dockerfile.rhel-x64 @@ -2,6 +2,6 @@ FROM centos:7 WORKDIR /nativebinaries COPY . /nativebinaries/ -RUN yum -y install gcc openssl cmake +RUN yum -y install cmake gcc libcurl-devel make openssl-devel CMD ["/bin/bash", "-c", "./build.libgit2.sh"] From 107128edfb1a3f7cf937d0862b8cf2e582ec8dfe Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 21 Apr 2018 18:13:58 -0400 Subject: [PATCH 13/16] Update fedora dev dependencies --- Dockerfile.fedora-x64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.fedora-x64 b/Dockerfile.fedora-x64 index 45732d8d..e23af04c 100644 --- a/Dockerfile.fedora-x64 +++ b/Dockerfile.fedora-x64 @@ -2,6 +2,6 @@ FROM fedora:26 WORKDIR /nativebinaries COPY . /nativebinaries/ -# RUN yum -y install gcc openssl cmake +RUN yum -y install cmake gcc libcurl-devel make openssl-devel CMD ["/bin/bash", "-c", "./build.libgit2.sh"] From cae5a47c12cdd08778ea7c4d9c7088caeea165b7 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 21 Apr 2018 18:54:51 -0400 Subject: [PATCH 14/16] Use standard windows RID instead --- build.libgit2.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.libgit2.ps1 b/build.libgit2.ps1 index 6e683e40..badec8e0 100644 --- a/build.libgit2.ps1 +++ b/build.libgit2.ps1 @@ -20,8 +20,8 @@ Set-StrictMode -Version Latest $projectDirectory = Split-Path $MyInvocation.MyCommand.Path $libgit2Directory = Join-Path $projectDirectory "libgit2" -$x86Directory = Join-Path $projectDirectory "nuget.package\runtimes\win7-x86\native" -$x64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win7-x64\native" +$x86Directory = Join-Path $projectDirectory "nuget.package\runtimes\win-x86\native" +$x64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win-x64\native" $hashFile = Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt" $sha = Get-Content $hashFile From 071d74421209a595c67124b7dbf1ecbb4e6073fa Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 21 Apr 2018 19:10:18 -0400 Subject: [PATCH 15/16] Update UpdateLibgit2ToSha.ps1 with new RIDs --- UpdateLibgit2ToSha.ps1 | 20 +++++++++++++------ .../net461/LibGit2Sharp.NativeBinaries.props | 20 +++++++++++++------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1 index 085b8aca..85a9d5d1 100644 --- a/UpdateLibgit2ToSha.ps1 +++ b/UpdateLibgit2ToSha.ps1 @@ -112,19 +112,19 @@ Push-Location $libgit2Directory $binaryFilename - + lib\win32\x64\$binaryFilename.dll PreserveNewest - + lib\win32\x64\$binaryFilename.pdb PreserveNewest - + lib\win32\x86\$binaryFilename.dll PreserveNewest - + lib\win32\x86\$binaryFilename.pdb PreserveNewest @@ -136,8 +136,16 @@ Push-Location $libgit2Directory lib\linux-x64\lib$binaryFilename.so PreserveNewest - - lib\centos-x64\lib$binaryFilename.so + + lib\rhel-x64\lib$binaryFilename.so + PreserveNewest + + + lib\fedora-x64\lib$binaryFilename.so + PreserveNewest + + + lib\debian.9-x64\lib$binaryFilename.so PreserveNewest diff --git a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props index fe4ffefe..f046e5c7 100644 --- a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props +++ b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props @@ -6,19 +6,19 @@ git2-6311e88 - + lib\win32\x64\git2-6311e88.dll PreserveNewest - + lib\win32\x64\git2-6311e88.pdb PreserveNewest - + lib\win32\x86\git2-6311e88.dll PreserveNewest - + lib\win32\x86\git2-6311e88.pdb PreserveNewest @@ -30,8 +30,16 @@ lib\linux-x64\libgit2-6311e88.so PreserveNewest - - lib\centos-x64\libgit2-6311e88.so + + lib\rhel-x64\libgit2-6311e88.so + PreserveNewest + + + lib\fedora-x64\libgit2-6311e88.so + PreserveNewest + + + lib\debian.9-x64\libgit2-6311e88.so PreserveNewest From 1c283efb513579cbb8879b7dd6f9a44fdc518b03 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sun, 22 Apr 2018 01:46:26 -0400 Subject: [PATCH 16/16] Update props file --- UpdateLibgit2ToSha.ps1 | 65 ++++--------------- .../build/LibGit2Sharp.NativeBinaries.props | 9 +++ .../net461/LibGit2Sharp.NativeBinaries.props | 47 +------------- nuget.package/libgit2/LibGit2Sharp.dll.config | 4 -- 4 files changed, 24 insertions(+), 101 deletions(-) delete mode 100644 nuget.package/libgit2/LibGit2Sharp.dll.config diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1 index 85a9d5d1..5a014b05 100644 --- a/UpdateLibgit2ToSha.ps1 +++ b/UpdateLibgit2ToSha.ps1 @@ -98,6 +98,15 @@ Push-Location $libgit2Directory $sha $binaryFilename + + + + + + + + + "@ @@ -105,51 +114,10 @@ Push-Location $libgit2Directory $net461BuildProperties = @" - - `$(MSBuildAllProjects);`$(MSBuildThisFileFullPath) - `$(MSBuildThisFileFullPath) - $sha - $binaryFilename - + - - lib\win32\x64\$binaryFilename.dll - PreserveNewest - - - lib\win32\x64\$binaryFilename.pdb - PreserveNewest - - - lib\win32\x86\$binaryFilename.dll - PreserveNewest - - - lib\win32\x86\$binaryFilename.pdb - PreserveNewest - - - lib\osx\lib$binaryFilename.dylib - PreserveNewest - - - lib\linux-x64\lib$binaryFilename.so - PreserveNewest - - - lib\rhel-x64\lib$binaryFilename.so - PreserveNewest - - - lib\fedora-x64\lib$binaryFilename.so - PreserveNewest - - - lib\debian.9-x64\lib$binaryFilename.so - PreserveNewest - - - LibGit2Sharp.dll.config + + runtimes\%(RecursiveDir)\%(Filename)%(Extension) PreserveNewest @@ -158,15 +126,6 @@ Push-Location $libgit2Directory Set-Content -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\build\net461\LibGit2Sharp.NativeBinaries.props") $net461BuildProperties - $dllConfig = @" - - - - -"@ - - Set-Content -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\libgit2\LibGit2Sharp.dll.config") $dllConfig - Write-Output "Done!" } exit diff --git a/nuget.package/build/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/LibGit2Sharp.NativeBinaries.props index d8637808..ae56cc42 100644 --- a/nuget.package/build/LibGit2Sharp.NativeBinaries.props +++ b/nuget.package/build/LibGit2Sharp.NativeBinaries.props @@ -5,4 +5,13 @@ 6311e886d8b5377c6037cd9937ccf66a71f3361d git2-6311e88 + + + + + + + + + diff --git a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props index f046e5c7..06276016 100644 --- a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props +++ b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props @@ -1,49 +1,8 @@ - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - $(MSBuildThisFileFullPath) - 6311e886d8b5377c6037cd9937ccf66a71f3361d - git2-6311e88 - + - - lib\win32\x64\git2-6311e88.dll - PreserveNewest - - - lib\win32\x64\git2-6311e88.pdb - PreserveNewest - - - lib\win32\x86\git2-6311e88.dll - PreserveNewest - - - lib\win32\x86\git2-6311e88.pdb - PreserveNewest - - - lib\osx\libgit2-6311e88.dylib - PreserveNewest - - - lib\linux-x64\libgit2-6311e88.so - PreserveNewest - - - lib\rhel-x64\libgit2-6311e88.so - PreserveNewest - - - lib\fedora-x64\libgit2-6311e88.so - PreserveNewest - - - lib\debian.9-x64\libgit2-6311e88.so - PreserveNewest - - - LibGit2Sharp.dll.config + + runtimes\%(RecursiveDir)\%(Filename)%(Extension) PreserveNewest diff --git a/nuget.package/libgit2/LibGit2Sharp.dll.config b/nuget.package/libgit2/LibGit2Sharp.dll.config deleted file mode 100644 index 59f111aa..00000000 --- a/nuget.package/libgit2/LibGit2Sharp.dll.config +++ /dev/null @@ -1,4 +0,0 @@ - - - -