Skip to content

Commit a09c27d

Browse files
authored
ci: install zstd for win arm64 straight from github releases (#4369)
1 parent db86c9c commit a09c27d

3 files changed

Lines changed: 28 additions & 6 deletions

File tree

.github/actions/environment/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ runs:
3535
# zstd is needed for cross OS actions/cache but missing from windows-11-arm
3636
# https://github.com/actions/partner-runner-images/issues/99
3737
- name: Install zstd on Windows ARM64
38-
if: runner.os == 'Windows' && runner.arch == 'ARM64'
39-
shell: pwsh
40-
run: choco install zstandard
38+
uses: ./.github/actions/install-zstd
4139

4240
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode
4341
- name: Pin the Xcode Version
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Install zstd on Windows ARM64
2+
description: |
3+
zstd is needed for cross OS actions/cache but missing from windows-11-arm
4+
(https://github.com/actions/partner-runner-images/issues/99). Once the issue
5+
is resolved, this action can be removed.
6+
inputs:
7+
version:
8+
description: 'zstd version'
9+
required: false
10+
default: '1.5.7'
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Install zstd
16+
if: runner.os == 'Windows' && runner.arch == 'ARM64'
17+
shell: pwsh
18+
env:
19+
ZSTD_VERSION: ${{ inputs.version }}
20+
run: |
21+
$url = "https://github.com/facebook/zstd/releases/download/v$env:ZSTD_VERSION/zstd-v$env:ZSTD_VERSION-win64.zip"
22+
$installDir = "$env:RUNNER_TOOL_CACHE\zstd-v$env:ZSTD_VERSION-win64"
23+
Invoke-WebRequest -OutFile "$env:TEMP\zstd.zip" -Uri $url
24+
Expand-Archive -Path "$env:TEMP\zstd.zip" -DestinationPath $env:RUNNER_TOOL_CACHE -Force
25+
echo "$installDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
26+
& "$installDir\zstd.exe" --version

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ jobs:
4343
# zstd is needed for cross OS actions/cache but missing from windows-11-arm
4444
# https://github.com/actions/partner-runner-images/issues/99
4545
- name: Install zstd on Windows ARM64
46-
if: runner.os == 'Windows' && runner.arch == 'ARM64'
47-
shell: pwsh
48-
run: choco install zstandard
46+
uses: ./.github/actions/install-zstd
4947

5048
- uses: actions/cache@v4
5149
id: cache

0 commit comments

Comments
 (0)