diff options
author | Patrick Steinhardt <ps@pks.im> | 2019-06-24 16:27:00 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2019-07-20 19:10:10 +0200 |
commit | 443df2dffd9d6973a6d7219f1de75c66453ffbdb (patch) | |
tree | aafff0328f7cfd87d0c2d5c0d68ebb713d28a8c1 | |
parent | d8e85d57ad0e681a78a7d2a98f6ba425143a41f6 (diff) | |
download | libgit2-443df2dffd9d6973a6d7219f1de75c66453ffbdb.tar.gz |
azure: replace mingw setup with bash
We're about to phase out our Powershell scripts as Azure
Pipelines does in fact support Bash scripts on all platforms. As
a preparatory step, let's replace our MinGW setup script with a
Bash script.
-rw-r--r-- | azure-pipelines.yml | 4 | ||||
-rw-r--r-- | azure-pipelines/nightly.yml | 4 | ||||
-rw-r--r-- | azure-pipelines/setup-mingw.ps1 | 25 | ||||
-rwxr-xr-x | azure-pipelines/setup-mingw.sh | 15 |
4 files changed, 19 insertions, 29 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7f491e0e1..98e809766 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -91,7 +91,7 @@ jobs: displayName: 'Windows (amd64; MinGW)' pool: Hosted steps: - - powershell: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.ps1' + - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh' displayName: Setup env: TEMP: $(Agent.TempDirectory) @@ -106,7 +106,7 @@ jobs: displayName: 'Windows (x86; MinGW)' pool: Hosted steps: - - powershell: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.ps1' + - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh' displayName: Setup workingDirectory: '$(Build.BinariesDirectory)' env: diff --git a/azure-pipelines/nightly.yml b/azure-pipelines/nightly.yml index 78e93f615..c494037ef 100644 --- a/azure-pipelines/nightly.yml +++ b/azure-pipelines/nightly.yml @@ -94,7 +94,7 @@ jobs: displayName: 'Windows (amd64; MinGW)' pool: Hosted steps: - - powershell: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.ps1' + - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh' displayName: Setup env: TEMP: $(Agent.TempDirectory) @@ -110,7 +110,7 @@ jobs: displayName: 'Windows (x86; MinGW)' pool: Hosted steps: - - powershell: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.ps1' + - bash: . '$(Build.SourcesDirectory)\azure-pipelines\setup-mingw.sh' displayName: Setup workingDirectory: '$(Build.BinariesDirectory)' env: diff --git a/azure-pipelines/setup-mingw.ps1 b/azure-pipelines/setup-mingw.ps1 deleted file mode 100644 index 76ecd3987..000000000 --- a/azure-pipelines/setup-mingw.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -Set-StrictMode -Version Latest - -$ErrorActionPreference = "Stop" -$PSDefaultParameterValues['*:ErrorAction'] = 'Stop' - -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - -[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem"); - -Write-Host "##############################################################################" -Write-Host "## Downloading mingw" -Write-Host "##############################################################################" - -if ($env:ARCH -eq "amd64") { - $mingw_uri = "https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-x86_64-8.1.0-release-win32-seh-rt_v6-rev0.zip" - $platform = "x86_64" -} else { - $mingw_uri = "https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-i686-8.1.0-release-win32-sjlj-rt_v6-rev0.zip" - $platform = "x86" -} - -$wc = New-Object net.webclient -$wc.Downloadfile($mingw_uri, "${Env:TEMP}/mingw-${Env:ARCH}.zip") - -[System.IO.Compression.ZipFile]::ExtractToDirectory("${Env:TEMP}/mingw-${Env:ARCH}.zip", $Env:TEMP) diff --git a/azure-pipelines/setup-mingw.sh b/azure-pipelines/setup-mingw.sh new file mode 100755 index 000000000..1172c2077 --- /dev/null +++ b/azure-pipelines/setup-mingw.sh @@ -0,0 +1,15 @@ +#!/bin/sh -e + +echo "##############################################################################" +echo "## Downloading mingw" +echo "##############################################################################" + +case "$ARCH" in + amd64) + MINGW_URI="https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-x86_64-8.1.0-release-win32-seh-rt_v6-rev0.zip";; + x86) + MINGW_URI="https://bintray.com/libgit2/build-dependencies/download_file?file_path=mingw-w64-i686-8.1.0-release-win32-sjlj-rt_v6-rev0.zip";; +esac + +curl -s -L "$MINGW_URI" -o "$TEMP"/mingw-"$ARCH".zip +unzip -q "$TEMP"/mingw-"$ARCH".zip -d "$TEMP" |