1- param (
2- [string ]$Version = " 1.0.0"
1+ param (
2+ [string ]$Version = " 1.0.0" ,
3+ [ValidateSet (" x64" , " arm64" )]
4+ [string ]$Arch = " x64"
35)
46
57$ErrorActionPreference = ' Stop'
@@ -18,10 +20,12 @@ New-Item -Path $buildDir -ItemType Directory -Force
1820
1921# region 7z
2022$7zDir = Join-Path $buildDir " 7z"
21- $7zDlPath = Join-Path $7zDir " 7z25.01-zstd-x64.exe"
2223New-Item - Path $7zDir - ItemType Directory - Force
24+
25+ $7zFileName = " 7z25.01-zstd-$Arch .exe"
26+ $7zDlPath = Join-Path $7zDir $7zFileName
2327$7zDlSplat = @ {
24- Uri = " https://github.com/mcmilk/7-Zip-zstd/releases/download/v25.01-v1.5.7-R3/7z25.01-zstd-x64.exe "
28+ Uri = " https://github.com/mcmilk/7-Zip-zstd/releases/download/v25.01-v1.5.7-R3/$7zFileName "
2529 OutFile = $7zDlPath
2630}
2731Invoke-WebRequest @7zDlSplat
@@ -30,11 +34,13 @@ tar -xzf $7zDlPath -C $7zDir
3034
3135# region curl-impersonate
3236$curlDir = Join-Path $buildDir " curl-impersonate"
33- $curlVersion = " v1.5.1"
34- $curlArchivePath = Join-Path $curlDir " libcurl-impersonate-$ ( $curlVersion ) .x86_64-win32.tar.gz"
37+ $curlVersion = " v1.5.6"
38+ $curlTriplet = if ($Arch -eq " arm64" ) { " arm64-win32" } else { " x86_64-win32" }
39+ $curlArchiveName = " libcurl-impersonate-$ ( $curlVersion ) .$curlTriplet .tar.gz"
40+ $curlArchivePath = Join-Path $curlDir $curlArchiveName
3541New-Item - Path " $curlDir " - Type Directory - Force
3642$curlImpersonateSplat = @ {
37- Uri = " https://github.com/lexiforest/curl-impersonate/releases/download/$ ( $curlVersion ) /libcurl-impersonate- $ ( $curlVersion ) .x86_64-win32.tar.gz "
43+ Uri = " https://github.com/lexiforest/curl-impersonate/releases/download/$ ( $curlVersion ) /$curlArchiveName "
3844 OutFile = $curlArchivePath
3945}
4046Invoke-WebRequest @curlImpersonateSplat
@@ -49,21 +55,22 @@ Invoke-WebRequest @cacertSplat
4955# region stalker-gamma-cli
5056$stalkerCliDir = Join-Path $buildDir " stalker-gamma-cli"
5157$pathToProject = (Join-Path (Join-Path $repoRoot " stalker-gamma-cli" ) " stalker-gamma-cli.csproj" )
52- dotnet publish - c Release $pathToProject - o $stalkerCliDir - p:AssemblyVersion= $Version
58+ $dotnetRid = " win-$Arch "
59+ dotnet publish - c Release $pathToProject - o $stalkerCliDir - r $dotnetRid - p:AssemblyVersion= $Version
5360# endregion
5461
5562$stalkerCliResourceDir = Join-Path $stalkerCliDir " resources"
5663New-Item - Path $stalkerCliResourceDir - ItemType Directory - Force
5764
5865Copy-Item - Path (Join-Path $7zDir " 7z.exe" ) - Destination (Join-Path $stalkerCliResourceDir " 7zz.exe" )
5966Copy-Item - Path (Join-Path $7zDir " 7z.dll" ) - Destination (Join-Path $stalkerCliResourceDir " 7z.dll" )
60- # Get-ChildItem -Path (Join-Path $curlDir "bin") -File | Where-Object {$_.Extension -ne '.bat'} | ForEach-Object {Copy-Item $_.FullName $stalkerCliDir }
6167Move-Item (Join-Path (Join-Path $curlDir " bin" ) " libcurl-impersonate.dll" ) $stalkerCliDir
6268Copy-Item - Path (Join-Path $curlDir " cacert.pem" ) - Destination (Join-Path $stalkerCliDir " cacert.pem" )
6369
6470Remove-Item - Path (Join-Path $stalkerCliDir " *.pdb" )
6571
66- if (Test-Path stalker- gamma+ win.x64.zip) {
67- Remove-Item stalker- gamma+ win.x64.zip - Force
72+ $zipName = " stalker-gamma+win.$Arch .zip"
73+ if (Test-Path $zipName ) {
74+ Remove-Item $zipName - Force
6875}
69- & (Join-Path $7zDir " 7z.exe" ) a - tzip - mx9 - r stalker - gamma + win.x64.zip (Join-Path $stalkerCliDir " *" )
76+ & (Join-Path $7zDir " 7z.exe" ) a - tzip - mx9 - r $zipName (Join-Path $stalkerCliDir " *" )
0 commit comments