clocktoy/build.ps1

30 lines
1.1 KiB
PowerShell

$date = Get-Date -Format 'yyyy-MM-dd'
$name = 'clocktoy-'+$date
$lovefile = "build\$($name).love"
$namewin = $name+'-win32'
$zipdir = 'build\'+$namewin
$zipfile = $zipdir+'.zip'
$exefile = "$($zipdir)\$($namewin).exe"
$loveversion = "11.4"
$lovename = "love-$($loveversion)-win32"
$loveurl = "https://github.com/love2d/love/releases/download/$($loveversion)/$($lovename).zip"
$lovezip = "build\$($lovename).zip"
if (Test-Path "build") {
Remove-Item "build" -Recurse
}
New-Item -Path "." -Name "build" -ItemType "directory"
Compress-Archive -Path "*.lua", "*.txt", "font" -DestinationPath $lovefile
Invoke-WebRequest $loveurl -OutFile $lovezip
(New-Object System.Net.WebClient).DownloadFile($loveurl, $lovezip)
Expand-Archive -Path $lovezip -DestinationPath "build"
New-Item -Path "build" -Name $namewin -ItemType "directory"
Get-Content "build\$($lovename)\love.exe", $lovefile -AsByteStream | Set-Content $exefile -AsByteStream
Copy-Item -Path "build\$($lovename)\*.dll", "build\$($lovename)\license.txt" -Destination $zipdir
Compress-Archive -Path $zipdir -Destination $zipfile