Last active
September 5, 2022 06:51
-
-
Save moreal/db0cf7b020dcf30845f917d85717083a to your computer and use it in GitHub Desktop.
"메인넷 업데이트 전 체크리스트" 문서를 따라 체크하는 데 도움을 주는 Powershell 스크립트
This file contains hidden or 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
| $apv=$args[0] | |
| $dict = @{} | |
| Write-Host "1. Try to parse apv" | |
| $result = $(planet.exe apv analyze $apv) | |
| foreach ($item in $result) { | |
| $splitted = $item.Split(" ") | |
| $key = $splitted | Where {!$_.Equals("")} | Select -First 1 | |
| $value = $splitted | Where {!$_.Equals("")} | Select -Last 1 | |
| $dict[$key] = $value | |
| } | |
| $dict | ConvertTo-Json | Write-Host | |
| $windowsBinaryUrl = $dict["extra.WindowsBinaryUrl"] | |
| $releaseDirectory = "./Windows" | |
| Write-Host "2. Try to download Windows.zip" | |
| Invoke-WebRequest -Uri "$windowsBinaryUrl" -OutFile "$releaseDirectory.zip" | |
| Remove-Item -Recurse -Force $releaseDirectory | |
| Expand-Archive ./Windows.zip $releaseDirectory | |
| Write-Host "3. Compare the given apv with apv in config.json" | |
| $releaseConfigPath = "$releaseDirectory/resources/app/config.json" | |
| $config = Get-Content $releaseConfigPath | ConvertFrom-Json | |
| if (!$apv.Equals($config.AppProtocolVersion)) { | |
| Write-Error "Sadly they are different... :("; | |
| Write-Error $apv | |
| Write-Error $config.AppProtocolVersion | |
| } else { | |
| Write-Host "Correct! :D" | |
| } | |
| Write-Host "[MANUAL] 4. Check digital signatures" | |
| $files = "Nine Chronicles.exe", "resources\app\9c.exe", "resources\app\publish\NineChronicles.Headless.Executable.exe"; | |
| foreach ($file in $files) { | |
| $path = "$releaseDirectory/$file" | |
| Write-Host "Signature of $path" | |
| Get-AuthenticodeSignature $path | |
| } | |
| Write-Host "[MANUAL] 5. Compare the versions with the versions in the release Notion page" | |
| $files = "Nine Chronicles.exe", "resources\app\publish\NineChronicles.Headless.Executable.exe"; | |
| foreach ($file in $files) { | |
| $path = "$releaseDirectory/$file" | |
| $version = (Get-Item $path).VersionInfo.ProductVersion | |
| Write-Host "The version of $path is $version" | |
| } | |
| Write-Host "[MANUAL][NOT IMPLEMENTED] 6. Check k8s-config PR" | |
| Write-Host "6-1. Docker 이미지 태그가 저장소에 있는지" | |
| Write-Host "6-2. Docker 이미지 태그에 기입된 버전이 릴리스 문서의 것과 일치하는지" | |
| Write-Host "6-3. APV 버전이 릴리스 문서의 것과 일치 하는지" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment