mirror of
https://github.com/felixrieseberg/windows95.git
synced 2026-05-09 00:24:09 +00:00
OneDrive 1drv.ms links no longer serve raw bytes to headless clients after the SPO migration. The disk image now lives as a release asset on a private repo and is fetched via 'gh release download' using DISK_REPO + DISK_TAG vars and an IMAGES_REPO_TOKEN secret. Scripts fail fast on missing env, bad zip, or missing windows95.img.
37 lines
1.1 KiB
PowerShell
37 lines
1.1 KiB
PowerShell
$ErrorActionPreference = "Stop"
|
|
|
|
# Pulls the disk image from a private GitHub release.
|
|
# Requires DISK_REPO, DISK_TAG, GH_TOKEN.
|
|
|
|
if (-not $env:DISK_REPO) { Write-Host "::error::DISK_REPO not set"; exit 1 }
|
|
if (-not $env:DISK_TAG) { Write-Host "::error::DISK_TAG not set"; exit 1 }
|
|
if (-not $env:GH_TOKEN) { Write-Host "::error::GH_TOKEN not set"; exit 1 }
|
|
|
|
New-Item -ItemType Directory -Force -Path images | Out-Null
|
|
Set-Location images
|
|
|
|
gh release download $env:DISK_TAG -R $env:DISK_REPO -p '*.zip' -O images.zip --clobber
|
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
|
|
7z t images.zip | Out-Null
|
|
if ($LASTEXITCODE -ne 0) {
|
|
$size = (Get-Item images.zip).Length
|
|
Write-Host "::error::Downloaded file is not a valid zip (size: $size bytes)."
|
|
exit 1
|
|
}
|
|
|
|
7z x images.zip -y -aoa
|
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
|
|
Remove-Item images.zip
|
|
Remove-Item __MACOSX -Recurse -ErrorAction Ignore
|
|
Set-Location ..
|
|
|
|
if (-not (Test-Path images/windows95.img)) {
|
|
Write-Host "::error::images/windows95.img not found after extraction"
|
|
Get-ChildItem images
|
|
exit 1
|
|
}
|
|
|
|
Get-ChildItem images
|