-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
release.ps1
48 lines (47 loc) · 2.43 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
47
48
$aliases_array_Win32 = "d3d8", "d3d9", "d3d10", "d3d11", "d3d12", "dinput8", "ddraw", "dinput", "dsound", "msacm32", "msvfw32", "version", "wininet", "winmm", "winhttp", "xlive", "vorbisFile", "binkw32", "bink2w32"
$aliases_array_x64 = "d3d9", "d3d10", "d3d11", "d3d12", "dinput8", "dsound", "version", "wininet", "winmm", "winhttp", "binkw64", "bink2w64"
$platform_array = "Win32", "x64"
$hash_alrg = "SHA512"
foreach ($platform in $platform_array)
{
mkdir "dist\$platform\dll"
mkdir "dist\$platform\zip"
if ($platform -eq "Win32") {
Move-Item ".\bin\$platform\Release\dinput8.dll" ".\bin\$platform\Release\_dinput8.dll"
foreach ($file in $aliases_array_Win32) {
Copy-Item ".\bin\$platform\Release\_dinput8.dll" ".\bin\$platform\Release\$file.dll"
}
}
else
{
Move-Item ".\bin\$platform\Release\dinput8.dll" ".\bin\$platform\Release\_dinput8.dll"
foreach ($file in $aliases_array_x64) {
Copy-Item ".\bin\$platform\Release\_dinput8.dll" ".\bin\$platform\Release\$file.dll"
}
}
if ($platform -eq "Win32") {
foreach ($file in $aliases_array_Win32) {
Get-FileHash ".\bin\$platform\Release\$file.dll" -Algorithm "$hash_alrg" | Format-List | Out-File -Encoding "utf8" ".\bin\$file-$platform.$hash_alrg"
Copy-Item ".\bin\$platform\Release\$file.dll", ".\bin\$file-$platform.$hash_alrg" -Destination ".\dist\$platform\dll\"
$compress = @{
Path = ".\bin\$platform\Release\$file.dll", ".\bin\$file-$platform.$hash_alrg"
CompressionLevel = "NoCompression"
DestinationPath = ".\dist\$platform\zip\$file-$platform.zip"
}
Compress-Archive @compress
}
}
else
{
foreach ($file in $aliases_array_x64) {
Get-FileHash ".\bin\$platform\Release\$file.dll" -Algorithm "$hash_alrg" | Format-List | Out-File -Encoding "utf8" ".\bin\$file-$platform.$hash_alrg"
Copy-Item ".\bin\$platform\Release\$file.dll", ".\bin\$file-$platform.$hash_alrg" -Destination ".\dist\$platform\dll\"
$compress = @{
Path = ".\bin\$platform\Release\$file.dll", ".\bin\$file-$platform.$hash_alrg"
CompressionLevel = "NoCompression"
DestinationPath = ".\dist\$platform\zip\$file-$platform.zip"
}
Compress-Archive @compress
}
}
}