-
Notifications
You must be signed in to change notification settings - Fork 100
/
release.ps1
46 lines (38 loc) · 2.09 KB
/
release.ps1
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
34
35
36
37
38
39
40
41
42
43
44
45
46
if ($PSScriptRoot -match '.+?\\bin\\?') {
$dir = $PSScriptRoot + "\"
}
else {
$dir = $PSScriptRoot + "\bin\"
}
$out = $dir + "out\"
$copy = $dir + "copy\"
$BIEdir = $dir + "BepInEx\"
$IL2CPPdir = $dir + "IL2CPP\"
$Coredir = $dir + "Core\"
$UMMdir = $dir + "UMM\"
$ver = (Get-Item ($Coredir + "\RuntimeUnityEditor.Core.dll")).VersionInfo.FileVersion.ToString() -replace "([\d+\.]+?\d+)[\.0]*$", '${1}'
New-Item -ItemType Directory -Force -Path ($out)
# BepInEx 5
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy)
Copy-Item -Path ($BIEdir) -Destination ($copy) -Recurse -Force
Copy-Item -Path ($Coredir+"*") -Destination ($copy + "BepInEx\plugins\RuntimeUnityEditor") -Recurse -Force
Compress-Archive -Path ($copy + "BepInEx") -Force -CompressionLevel "Optimal" -DestinationPath ($out + "RuntimeUnityEditor_BepInEx5_v" + $ver + ".zip")
# BepInEx 6 IL2CPP
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
$copyDeep = $copy + "BepInEx\plugins\RuntimeUnityEditor"
New-Item -ItemType Directory -Force -Path ($copyDeep)
Copy-Item -Path ($IL2CPPdir + "*") -Destination ($copyDeep) -Recurse -Force
Copy-Item -Path ($dir + "\..\README.md") -Destination ($copyDeep) -Recurse -Force
Copy-Item -Path ($dir + "\..\LICENSE") -Destination ($copyDeep) -Recurse -Force
Compress-Archive -Path ($copy + "BepInEx") -Force -CompressionLevel "Optimal" -DestinationPath ($out + "RuntimeUnityEditor_BepInEx6.IL2CPP_v" + $ver + ".zip")
# UMM
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path ($copy)
Copy-Item -Path ($UMMdir+"*") -Destination ($copy) -Recurse -Force
Copy-Item -Path ($Coredir+"*") -Destination ($copy) -Recurse -Force
$info = Get-Content ($copy+"Info.json") -raw | ConvertFrom-Json
$info.Version = $ver
$info | ConvertTo-Json | Set-Content ($copy+"Info.json")
Compress-Archive -Path ($copy+"*") -Force -CompressionLevel "Optimal" -DestinationPath ($out + "RuntimeUnityEditor_UMM_v" + $ver + ".zip")
Remove-Item -Force -Path ($copy) -Recurse -ErrorAction SilentlyContinue