-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#29) CI: use Dependencies instead of dumpbin
- Loading branch information
Showing
5 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/.idea/ | ||
/build/ | ||
|
||
*.temp.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# NOTE: Only used in tests right now. | ||
param ( | ||
$DependenciesLink = 'https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release_.without.peview.exe.zip', | ||
$DependenciesHash = '7D22DC00F1C09FD4415D48AD74D1CF801893E83B9A39944B0FCE6DEA7CEAEA99', | ||
$DownloadStorage = "$PSScriptRoot/../build/downloads", | ||
$DependenciesInstallPath = "$PSScriptRoot/../build/tools/dependencies" | ||
) | ||
|
||
$ErrorActionPreference = 'Stop' | ||
Set-StrictMode -Version Latest | ||
|
||
if (!(Test-Path $DownloadStorage)) { | ||
New-Item -Type Directory $DownloadStorage | Out-Null | ||
} | ||
|
||
$dependenciesFileName = [Uri]::new($DependenciesLink).Segments | Select-Object -Last 1 | ||
$dependenciesDownloadPath = "$DownloadStorage/$dependenciesFileName" | ||
if (Test-Path $dependenciesDownloadPath) { | ||
Write-Output "File `"$dependenciesDownloadPath`" already exists; checking its hash…" | ||
$actualHash = Get-FileHash -Algorithm SHA256 $dependenciesDownloadPath | ||
if ($actualHash.Hash -eq $DependenciesHash) { | ||
Write-Output 'Hash check succeeded; reusing the downloaded item.' | ||
} else { | ||
Write-Output "Actual hash: $($actualHash.Hash)." | ||
Write-Output "Expected hash: $DependenciesHash." | ||
Write-Output "Deleting file for re-download…" | ||
Remove-Item $dependenciesDownloadPath | ||
} | ||
} | ||
|
||
if (!(Test-Path $dependenciesDownloadPath)) { | ||
Write-Output "Downloading `"$DependenciesLink`"…" | ||
Invoke-WebRequest $DependenciesLink -OutFile $dependenciesDownloadPath | ||
} | ||
|
||
$actualHash = Get-FileHash -Algorithm SHA256 $dependenciesDownloadPath | ||
if ($actualHash.Hash -ne $DependenciesHash) { | ||
Write-Output "Actual hash: $($actualHash.Hash)." | ||
Write-Output "Expected hash: $DependenciesHash." | ||
Write-Output "Hashes don't match." | ||
throw 'Cannot download Dependencies tool.' | ||
} | ||
|
||
if (Test-Path $DependenciesInstallPath) { | ||
Remove-Item -Recurse $DependenciesInstallPath | ||
} | ||
|
||
Expand-Archive $dependenciesDownloadPath $DependenciesInstallPath | ||
Write-Output "Dependencies tool installed to directory `"$DependenciesInstallPath`"." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters