Skip to content

Commit b8263d2

Browse files
committed
update chocolatey
1 parent 4064aae commit b8263d2

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ jobs:
363363
update-aur:
364364
name: update-aur
365365
runs-on: ubuntu-22.04
366-
needs: [cli-ubuntu-arm64, cli-ubuntu-x64]
366+
needs: [update-chocolatey, cli-ubuntu-arm64, cli-ubuntu-x64]
367367
if: github.ref_type == 'tag'
368368
steps:
369369
- name: Checkout
@@ -407,7 +407,7 @@ jobs:
407407
update-homebrew:
408408
name: update-homebrew
409409
runs-on: ubuntu-22.04
410-
needs: [cli-macos-x64, cli-macos-arm64]
410+
needs: [update-chocolatey, cli-macos-x64, cli-macos-arm64]
411411
if: github.ref_type == 'tag'
412412
steps:
413413
- name: Checkout source repo

build/win/chocolatey.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
SET script_dir=%~dp0
22
SET version=%~1
33
SET choco_api_key=%~2
4-
SET path_to_archive=%~3
54
if not defined version SET version=1.0.0
6-
pwsh.exe -noprofile -executionpolicy bypass -file %script_dir%chocolatey.ps1 -Version %version% -ChocolateyApiKey %choco_api_key% -PathToArchive %path_to_archive%
5+
pwsh.exe -noprofile -executionpolicy bypass -file %script_dir%chocolatey.ps1 -Version %version% -ChocolateyApiKey %choco_api_key%

build/win/chocolatey.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ $releaseResponse = Invoke-RestMethod @getReleaseSplat
2424
$winAssetX64 = $releaseResponse.assets | Where-Object {$_.name -like '*+win.x64*'} | Select-Object -First 1
2525
$winAssetX64Sha256 = $winAssetX64.digest -replace 'sha256:', ''
2626

27+
$winAssetArm64 = $releaseResponse.assets | Where-Object {$_.name -like '*+win.arm64*'} | Select-Object -First 1
28+
$winAssetArm64Sha256 = $winAssetArm64.digest -replace 'sha256:', ''
29+
2730
#region chocolatey
2831
if (Get-Command choco) {
2932
$chocoNuspec = @"
@@ -44,8 +47,14 @@ if (Get-Command choco) {
4447
"@
4548
$chocoInstall = @"
4649
`$packageName = 'stalker-gamma'
47-
`$url = 'https://github.com/FaithBeam/stalker-gamma-cli/releases/download/$($Version)/$($winAssetX64.name)'
48-
`$checksum = '$($winAssetX64Sha256)'
50+
51+
if (`$env:PROCESSOR_ARCHITECTURE -eq 'ARM64') {
52+
`$url = 'https://github.com/FaithBeam/stalker-gamma-cli/releases/download/$($Version)/$($winAssetArm64.name)'
53+
`$checksum = '$($winAssetArm64Sha256)'
54+
} else {
55+
`$url = 'https://github.com/FaithBeam/stalker-gamma-cli/releases/download/$($Version)/$($winAssetX64.name)'
56+
`$checksum = '$($winAssetX64Sha256)'
57+
}
4958
5059
`$packageArgs = @{
5160
packageName = `$packageName

0 commit comments

Comments
 (0)