mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Hoist common Windows dep grabbing code to a script
Function courtesy of @aaaaaa123456789
This commit is contained in:
27
.github/workflows/create-release-artifacts.yaml
vendored
27
.github/workflows/create-release-artifacts.yaml
vendored
@@ -25,31 +25,8 @@ jobs:
|
||||
VERSION="${{ github.ref_name }}"
|
||||
echo "version=${VERSION#v}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v2
|
||||
- name: Get zlib, libpng and bison
|
||||
run: | # TODO: use an array; remember to update the versions being downloaded, *and* the paths being extracted! (`Move-Item`)
|
||||
$wc = New-Object System.Net.WebClient
|
||||
$wc.DownloadFile('https://www.zlib.net/zlib1213.zip', 'zlib.zip')
|
||||
$hash = (Get-FileHash "zlib.zip" -Algorithm SHA256).Hash
|
||||
if ($hash -ne 'd233fca7cf68db4c16dc5287af61f3cd01ab62495224c66639ca3da537701e42') {
|
||||
Write-Host "zlib SHA256 mismatch! ($hash)"
|
||||
exit 1
|
||||
}
|
||||
$wc.DownloadFile('https://download.sourceforge.net/libpng/lpng1637.zip', 'libpng.zip')
|
||||
$hash = (Get-FileHash "libpng.zip" -Algorithm SHA256).Hash
|
||||
if ($hash -ne '3b4b1cbd0bae6822f749d39b1ccadd6297f05e2b85a83dd2ce6ecd7d09eabdf2') {
|
||||
Write-Host "libpng SHA256 mismatch! ($hash)"
|
||||
exit 1
|
||||
}
|
||||
$wc.DownloadFile('https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip', 'winflexbison.zip')
|
||||
$hash = (Get-FileHash "winflexbison.zip" -Algorithm SHA256).Hash
|
||||
if ($hash -ne '39c6086ce211d5415500acc5ed2d8939861ca1696aee48909c7f6daf5122b505') {
|
||||
Write-Host "bison SHA256 mismatch! ($hash)"
|
||||
}
|
||||
Expand-Archive -DestinationPath . "zlib.zip"
|
||||
Expand-Archive -DestinationPath . "libpng.zip"
|
||||
Expand-Archive -DestinationPath install_dir "winflexbison.zip"
|
||||
Move-Item zlib-1.2.13 zlib
|
||||
Move-Item lpng1637 libpng
|
||||
- name: Install deps
|
||||
run: .github/scripts/get_win_deps.ps1
|
||||
- uses: actions/cache@v3
|
||||
id: cache
|
||||
with:
|
||||
|
||||
27
.github/workflows/testing.yml
vendored
27
.github/workflows/testing.yml
vendored
@@ -76,31 +76,8 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Get zlib, libpng and bison
|
||||
run: | # TODO: use an array; remember to update the versions being downloaded, *and* the paths being extracted! (`Move-Item`)
|
||||
$wc = New-Object System.Net.WebClient
|
||||
$wc.DownloadFile('https://www.zlib.net/zlib1213.zip', 'zlib.zip')
|
||||
$hash = (Get-FileHash "zlib.zip" -Algorithm SHA256).Hash
|
||||
if ($hash -ne 'd233fca7cf68db4c16dc5287af61f3cd01ab62495224c66639ca3da537701e42') {
|
||||
Write-Host "zlib SHA256 mismatch! ($hash)"
|
||||
exit 1
|
||||
}
|
||||
$wc.DownloadFile('https://download.sourceforge.net/libpng/lpng1637.zip', 'libpng.zip')
|
||||
$hash = (Get-FileHash "libpng.zip" -Algorithm SHA256).Hash
|
||||
if ($hash -ne '3b4b1cbd0bae6822f749d39b1ccadd6297f05e2b85a83dd2ce6ecd7d09eabdf2') {
|
||||
Write-Host "libpng SHA256 mismatch! ($hash)"
|
||||
exit 1
|
||||
}
|
||||
$wc.DownloadFile('https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip', 'winflexbison.zip')
|
||||
$hash = (Get-FileHash "winflexbison.zip" -Algorithm SHA256).Hash
|
||||
if ($hash -ne '39c6086ce211d5415500acc5ed2d8939861ca1696aee48909c7f6daf5122b505') {
|
||||
Write-Host "bison SHA256 mismatch! ($hash)"
|
||||
}
|
||||
Expand-Archive -DestinationPath . "zlib.zip"
|
||||
Expand-Archive -DestinationPath . "libpng.zip"
|
||||
Expand-Archive -DestinationPath install_dir "winflexbison.zip"
|
||||
Move-Item zlib-1.2.13 zlib
|
||||
Move-Item lpng1637 libpng
|
||||
- name: Install deps
|
||||
run: .github/scripts/get_win_deps.ps1
|
||||
- uses: actions/cache@v3
|
||||
id: cache
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user