-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathdeploy-package.ps1
More file actions
33 lines (27 loc) · 1.06 KB
/
deploy-package.ps1
File metadata and controls
33 lines (27 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Powershell script that zips ST2U into a package to be installed by Unity Package Manager
try
{
Push-Location $PSScriptRoot
# Get the current version of Super Tiled2Unity
$package_dir = '../SuperTiled2Unity/Packages/com.seanba.super-tiled2unity'
$package_json = "$package_dir/package.json"
$version = (Get-Content $package_json | ConvertFrom-Json).version
$output = "super-tiled2unity.v$version.zip"
$copy = "com.seanba.super-tiled2unity.zip"
Write-Host Packaging Super Tiled2Unity version $version
Write-Host $output
# Note: Zip files made with Compress-Archive are not compatible with Linux
# Use 7-Zip instead
& "C:\Program Files\7-Zip\7z.exe" a -tzip -o".\" "$output" "$package_dir\*" -aoa
Copy-Item $output -Destination com.seanba.super-tiled2unity.zip
# Make sure hashes are same between latest version and copy
if ((Get-FileHash $output).Hash -ne (Get-FileHash $copy).Hash)
{
Write-Error "Wrong hash. What happened?"
}
Write-Host "Done zipping '$output'"
}
finally
{
Pop-Location
}