diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 8cd9edc..c3bff85 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -12,19 +12,24 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - tinygo: ['0.33.0', '0.34.0', '0.35.0'] + os: + - macos-latest + - ubuntu-latest + - ubuntu-24.04-arm + - windows-latest + # - windows-11-arm - Binaryen does not provide binaries for Windows on ARM as of v123 + tinygo: ['0.36.0', '0.37.0'] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version: '1.24' - name: setup-tinygo ${{ matrix.tinygo }} uses: ./ with: tinygo-version: ${{ matrix.tinygo }} - binaryen-version: '121' + binaryen-version: '123' - name: Verify version run: ./check-version.sh ${{ matrix.tinygo }} @@ -43,12 +48,12 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version: '1.24' - name: setup-tinygo uses: ./ with: - tinygo-version: '0.35.0' + tinygo-version: '0.37.0' install-binaryen: 'false' - name: Binaryen not installed diff --git a/dist/index.js b/dist/index.js index 57ccf5f..7c9cb79 100644 --- a/dist/index.js +++ b/dist/index.js @@ -51,8 +51,8 @@ const path_1 = __importDefault(__nccwpck_require__(928)); const utils_1 = __nccwpck_require__(277); const sys_1 = __nccwpck_require__(774); const toolName = 'binaryen'; -const arch = (0, sys_1.getArch)(); const platform = (0, sys_1.getPlatform)(); +const arch = (0, sys_1.getArch)(platform); async function installBinaryen(version) { const installPath = await extract(version); return addToPath(installPath, version); @@ -118,9 +118,16 @@ function getPlatform() { const platform = os_1.default.platform(); return platformMap[platform] ?? platform; } -function getArch() { +function getArch(platform) { const arch = os_1.default.arch(); - return arch === 'x64' ? 'x86_64' : arch; + switch (arch) { + case 'arm64': + return platform === 'linux' ? 'aarch64' : 'arm64'; + case 'x64': + return 'x86_64'; + default: + return arch; + } } diff --git a/src/binaryen/install.ts b/src/binaryen/install.ts index e949333..112f84b 100644 --- a/src/binaryen/install.ts +++ b/src/binaryen/install.ts @@ -6,8 +6,8 @@ import { printCommand } from '../utils'; import { getArch, getPlatform } from './sys'; const toolName = 'binaryen'; -const arch = getArch(); const platform = getPlatform(); +const arch = getArch(platform); export async function installBinaryen(version: string): Promise { const installPath = await extract(version); diff --git a/src/binaryen/sys.ts b/src/binaryen/sys.ts index 25625be..893a99b 100644 --- a/src/binaryen/sys.ts +++ b/src/binaryen/sys.ts @@ -10,7 +10,14 @@ export function getPlatform(): string { return platformMap[platform] ?? platform; } -export function getArch(): string { +export function getArch(platform: string): string { const arch = os.arch(); - return arch === 'x64' ? 'x86_64' : arch; + switch (arch) { + case 'arm64': + return platform === 'linux' ? 'aarch64' : 'arm64'; + case 'x64': + return 'x86_64'; + default: + return arch; + } }