Files
NumberSwipe_New/wechat-campaign-200-r2/package.ps1
T

10 lines
808 B
PowerShell

$ErrorActionPreference = 'Stop'
$releaseDir = Join-Path (Split-Path $PSScriptRoot -Parent) 'releases'
New-Item -ItemType Directory -Path $releaseDir -Force | Out-Null
$releaseInfo = Get-Content -LiteralPath (Join-Path $PSScriptRoot 'release-info.json') -Raw -Encoding UTF8 | ConvertFrom-Json
$archivePath = Join-Path $releaseDir $releaseInfo.package
$assets = @('game.js','game.json','project.config.json','audio','audio-original','music','fonts','release-info.json') | ForEach-Object { Join-Path $PSScriptRoot $_ }
Compress-Archive -LiteralPath $assets -DestinationPath $archivePath -Force
$hashStream = [IO.File]::OpenRead($archivePath)
try { $hasher = [Security.Cryptography.SHA256]::Create(); [BitConverter]::ToString($hasher.ComputeHash($hashStream)).Replace('-','') } finally { $hashStream.Dispose() }