-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -351,3 +351,5 @@ MigrationBackup/ | |
|
||
# protobuf generated stuffs | ||
**/Proto/Out/*.cs | ||
|
||
/_publish/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
$release_dir = Resolve-Path "bin\Release"; | ||
|
||
$version = Get-Content SakuraLibrary\AssemblyBase.cs | Select-String "AssemblyVersion\(`"(.+)`"\)"; | ||
$version = $version.Matches[0].Groups[1].Value; | ||
|
||
function PrepareDir { | ||
param ( | ||
$Dir | ||
) | ||
|
||
Remove-Item -Path $Dir -Recurse -ErrorAction SilentlyContinue; | ||
New-Item -Name $Dir -ItemType "directory" -ErrorAction SilentlyContinue; | ||
} | ||
|
||
function PrepareVariation { | ||
param ( | ||
$Variation | ||
) | ||
|
||
$target = "${Variation}_$version"; | ||
|
||
PrepareDir $target; | ||
Get-ChildItem -Path $release_dir | Where-Object { | ||
$_.Name -eq "$Variation.exe.config" -or ( | ||
$_.Extension -match "\.(dll)$" -and | ||
$_.Name -ne "SakuraLibrary.dll" -and | ||
$_.Name -ne "libsodium-64.dll" | ||
) -or ( | ||
$_.Extension -match "\.(config)$" -and | ||
$_.Name -notmatch "Launcher\.exe\.config$" | ||
) | ||
} | Copy-Item -Destination $target; | ||
} | ||
|
||
New-Item -Name _publish -ItemType "directory" -ErrorAction SilentlyContinue; | ||
Set-Location _publish; | ||
|
||
# Prepare 2 variations | ||
PrepareVariation SakuraLauncher | ||
PrepareVariation LegacyLauncher | ||
|
||
# Prepare files to be signed | ||
PrepareDir "sign"; | ||
Get-ChildItem -Path $release_dir | Where-Object { | ||
$_.Extension -match "\.exe$" -or | ||
$_.Name -eq "SakuraLibrary.dll" | ||
} | Copy-Item -Destination sign; | ||
|
||
Copy-Item frpc_windows_386.exe, frpc_windows_amd64.exe sign -ErrorAction SilentlyContinue; | ||
|
||
Compress-Archive -Force -CompressionLevel Optimal -Path sign -DestinationPath "sign_$version.zip"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
$version = Get-Content SakuraLibrary\AssemblyBase.cs | Select-String "AssemblyVersion\(`"(.+)`"\)"; | ||
$version = $version.Matches[0].Groups[1].Value; | ||
|
||
function DeployVariation { | ||
param ( | ||
$Variation | ||
) | ||
|
||
$target = "${Variation}_$version"; | ||
|
||
$files = Get-ChildItem -Path "sign" | Where-Object { | ||
$_.Name -eq "$Variation.exe" -or ( | ||
$_.Extension -match "\.(exe)$" -and | ||
$_.Name -notmatch "Launcher\.exe$" -and | ||
$_.Name -notmatch "^frpc_" | ||
) -or ( | ||
$_.Extension -match "\.(dll)$" | ||
) | ||
}; | ||
$files | Copy-Item -Destination $target; | ||
$files | ForEach-Object -Process { | ||
openssl dgst -sign $env:SAKURA_SIGN_KEY -sha256 -out "$target\$($_.Name).sig" $_.FullName | ||
}; | ||
|
||
Copy-Item "sign\frpc_windows_386.exe" "$target\frpc.exe"; | ||
openssl dgst -sign $env:SAKURA_SIGN_KEY -sha256 -out "$target\frpc.exe.sig" "sign\frpc_windows_386.exe"; | ||
} | ||
|
||
Set-Location _publish; | ||
|
||
DeployVariation SakuraLauncher | ||
DeployVariation LegacyLauncher |