Skip to content

Commit 78e48c4

Browse files
committed
ci: install zstd for win arm64 straight from github releases
1 parent f98d337 commit 78e48c4

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
@@ -27,9 +27,7 @@ runs:
2727
# zstd is needed for cross OS actions/cache but missing from windows-11-arm
2828
# https://github.com/actions/partner-runner-images/issues/99
2929
- name: Install zstd on Windows ARM64
30-
if: runner.os == 'Windows' && runner.arch == 'ARM64'
31-
shell: pwsh
32-
run: choco install zstandard
30+
uses: ./.github/actions/install-zstd
3331

3432
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode
3533
- 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)