ci: use a single setup script for mingw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
diff --git a/.vsts-ci.yml b/.vsts-ci.yml
index 07c38ee..2731e0a 100644
--- a/.vsts-ci.yml
+++ b/.vsts-ci.yml
@@ -176,10 +176,11 @@ phases:
queue:
name: Hosted
steps:
- - powershell: . '$(Build.SourcesDirectory)\ci\setup-mingw-amd64.ps1'
+ - powershell: . '$(Build.SourcesDirectory)\ci\setup-mingw.ps1'
displayName: Setup
env:
TEMP: $(Agent.TempDirectory)
+ ARCH: amd64
- powershell: . '$(Build.SourcesDirectory)\ci\build.ps1'
displayName: Build
env:
@@ -193,10 +194,11 @@ phases:
queue:
name: Hosted
steps:
- - powershell: . '$(Build.SourcesDirectory)\ci\setup-mingw-x86.ps1'
+ - powershell: . '$(Build.SourcesDirectory)\ci\setup-mingw.ps1'
displayName: Setup
env:
TEMP: $(Agent.TempDirectory)
+ ARCH: x86
- powershell: . '$(Build.SourcesDirectory)\ci\build.ps1'
displayName: Build
env:
diff --git a/ci/setup-mingw-amd64.ps1 b/ci/setup-mingw-amd64.ps1
deleted file mode 100644
index eaa6709..0000000
--- a/ci/setup-mingw-amd64.ps1
+++ /dev/null
@@ -1,20 +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 "##############################################################################"
-
-$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"
-
-$wc = New-Object net.webclient
-$wc.Downloadfile($mingw_uri, "${Env:TEMP}/mingw-${platform}.zip")
-
-[System.IO.Compression.ZipFile]::ExtractToDirectory("${Env:TEMP}/mingw-${platform}.zip", $Env:TEMP)
diff --git a/ci/setup-mingw-x86.ps1 b/ci/setup-mingw-x86.ps1
deleted file mode 100644
index 832c0f5..0000000
--- a/ci/setup-mingw-x86.ps1
+++ /dev/null
@@ -1,20 +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 "##############################################################################"
-
-$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-${platform}.zip")
-
-[System.IO.Compression.ZipFile]::ExtractToDirectory("${Env:TEMP}/mingw-${platform}.zip", $Env:TEMP)
diff --git a/ci/setup-mingw.ps1 b/ci/setup-mingw.ps1
new file mode 100644
index 0000000..76ecd39
--- /dev/null
+++ b/ci/setup-mingw.ps1
@@ -0,0 +1,25 @@
+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)