From 3a5a7a01a2e5e6c6920c0feeb6a47853cb7e72be Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 12 Jul 2025 17:58:41 +0900 Subject: [PATCH 1/3] support Windows 11 ARM64 on SnapshotInstaller --- src/snapshot_bucket.ts | 8 ++++++-- src/snapshot_installer.ts | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/snapshot_bucket.ts b/src/snapshot_bucket.ts index e8f4c79..971d705 100644 --- a/src/snapshot_bucket.ts +++ b/src/snapshot_bucket.ts @@ -47,14 +47,16 @@ const browserFileName = ({ os }: Platform): string => { } }; -const driverFileName = ({ os }: Platform): string => { +const driverFileName = ({ os, arch }: Platform): string => { switch (os) { case OS.DARWIN: return "chromedriver_mac64.zip"; case OS.LINUX: return "chromedriver_linux64.zip"; case OS.WINDOWS: - return "chromedriver_win32.zip"; + return arch === Arch.ARM64 + ? "chromedriver_win64.zip" + : "chromedriver_win32.zip"; } }; @@ -71,6 +73,8 @@ const makePlatformPart = ({ os, arch }: Platform): string => { return "Win"; } else if (os === OS.WINDOWS && arch === Arch.AMD64) { return "Win_x64"; + } else if (os === OS.WINDOWS && arch === Arch.ARM64) { + return "Win_Arm64"; } throw new Error(`Unsupported platform "${os}" "${arch}"`); }; diff --git a/src/snapshot_installer.ts b/src/snapshot_installer.ts index 3d0d916..5d90291 100644 --- a/src/snapshot_installer.ts +++ b/src/snapshot_installer.ts @@ -3,7 +3,7 @@ import * as core from "@actions/core"; import * as tc from "@actions/tool-cache"; import * as cache from "./cache"; import type { DownloadResult, InstallResult, Installer } from "./installer"; -import { OS, type Platform } from "./platform"; +import { Arch, OS, type Platform } from "./platform"; import { browserDownloadURL, driverDownloadURL } from "./snapshot_bucket"; export class SnapshotInstaller implements Installer { @@ -85,7 +85,9 @@ export class SnapshotInstaller implements Installer { case OS.LINUX: return path.join(extPath, "chromedriver_linux64"); case OS.WINDOWS: - return path.join(extPath, "chromedriver_win32"); + return this.platform.arch === Arch.ARM64 + ? path.join(extPath, "chromedriver_win64") + : path.join(extPath, "chromedriver_win32"); } })(); const bin = (() => { From 158149701543e3679a01c004ff872852c3930bf9 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 12 Jul 2025 22:11:52 +0900 Subject: [PATCH 2/3] Test snapshot installer on Windows 11 ARM64 --- .github/workflows/build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 919283b..96b6489 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,6 +52,24 @@ jobs: (Get-Item (Get-Command "${{ steps.setup-chrome.outputs.chrome-path }}").Source).VersionInfo.ProductVersion (Get-Item (Get-Command "${{ steps.setup-chrome.outputs.chromedriver-path }}").Source).VersionInfo.ProductVersion + test-windows-arm: + needs: [build] + runs-on: windows-11-arm + steps: + - uses: actions/download-artifact@v4 + with: + name: dist + + - name: Install Google Chrome + uses: ./ + with: + chrome-version: 1485971 + install-chromedriver: true + id: setup-chrome + - run: | + (Get-Item (Get-Command "${{ steps.setup-chrome.outputs.chrome-path }}").Source).VersionInfo.ProductVersion + (Get-Item (Get-Command "${{ steps.setup-chrome.outputs.chromedriver-path }}").Source).VersionInfo.ProductVersion + test-install-dependencies: needs: [build] strategy: From cf0bd3ab4f252540a7ea2ac0198d14ad33b75d19 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 12 Jul 2025 22:46:22 +0900 Subject: [PATCH 3/3] Update README --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b4c039f..79c70f0 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The action installs the stable version of Chrome for Testing by default. ```yaml steps: - - uses: browser-actions/setup-chrome@v1 + - uses: browser-actions/setup-chrome@v2 - run: chrome --version ``` @@ -26,7 +26,7 @@ To install a specific channel, use `chrome-version` input. ```yaml steps: - - uses: browser-actions/setup-chrome@v1 + - uses: browser-actions/setup-chrome@v2 with: chrome-version: 120 ``` @@ -36,7 +36,7 @@ You can use the `install-chromedriver` to install the ChromeDriver. ```yaml steps: - - uses: browser-actions/setup-chrome@v1 + - uses: browser-actions/setup-chrome@v2 with: chrome-version: 120 install-chromedriver: true @@ -48,7 +48,7 @@ It installs the required dependencies for the Google Chrome/Chromium to run auto ```yaml steps: - - uses: browser-actions/setup-chrome@v1 + - uses: browser-actions/setup-chrome@v2 with: chrome-version: 120 install-dependencies: true @@ -74,7 +74,7 @@ To get the installed binary path, use `chrome-path` output of the action: ```yaml steps: - - uses: browser-actions/setup-chrome@v1 + - uses: browser-actions/setup-chrome@v2 id: setup-chrome - run: | ${{ steps.setup-chrome.outputs.chrome-path }} --version @@ -102,6 +102,15 @@ steps: [snapshots]: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html +## Supported platforms + +| | Linux x64 | Mac x64 | Mac Arm64 | Windows | Windows Arm64 | +| --- | --- | --- | --- | --- | --- | +| Channel name (e.g. `stable`) | ✅ | ✅ | ✅ | ✅ | ❌ | +| Commit position (e.g. `1295939`) | ✅ | ✅ | ✅ | ✅ | ✅ | +| Specific version (e.g. `120.0.6099`) | ✅ | ✅ | ✅ | ✅ | ❌ | +| Latest snapshot | ✅ | ✅ | ✅ | ✅ | ✅ | + ## License [MIT](LICENSE)