Skip to content

Commit ec5d184

Browse files
authored
feat: support linux arm64 public preview (#1144)
1 parent a0297a1 commit ec5d184

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
matrix:
4848
os:
4949
- ubuntu-latest
50+
- ubuntu-24.04-arm
5051
- macos-latest
5152
- windows-latest
5253
version:
@@ -75,6 +76,7 @@ jobs:
7576
matrix:
7677
os:
7778
- ubuntu-latest
79+
- ubuntu-24.04-arm
7880
- macos-latest
7981
- windows-latest
8082
version:
@@ -104,6 +106,7 @@ jobs:
104106
matrix:
105107
os:
106108
- ubuntu-latest
109+
- ubuntu-24.04-arm
107110
- macos-latest
108111
- windows-latest
109112
runs-on: ${{ matrix.os }}

dist/post_run/index.js

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/run/index.js

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/install.ts

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const getAssetURL = (versionConfig: VersionConfig): string => {
2222
}
2323
let arch = os.arch()
2424
switch (arch) {
25+
case "arm64":
26+
arch = "arm64"
27+
break
2528
case "x64":
2629
arch = "amd64"
2730
break

src/version.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as core from "@actions/core"
22
import * as httpm from "@actions/http-client"
33
import * as fs from "fs"
4+
import os from "os"
45
import path from "path"
56

67
import { InstallMode } from "./install"
@@ -139,10 +140,14 @@ export async function findLintVersion(mode: InstallMode): Promise<VersionConfig>
139140
// if the patched version is passed, just use it
140141
if (reqLintVersion?.major !== null && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) {
141142
return new Promise((resolve) => {
143+
let arch: string = "amd64"
144+
if (os.arch() === "arm64") {
145+
arch = "arm64"
146+
}
142147
const versionWithoutV = `${reqLintVersion.major}.${reqLintVersion.minor}.${reqLintVersion.patch}`
143148
resolve({
144149
TargetVersion: `v${versionWithoutV}`,
145-
AssetURL: `https://github.com/golangci/golangci-lint/releases/download/v${versionWithoutV}/golangci-lint-${versionWithoutV}-linux-amd64.tar.gz`,
150+
AssetURL: `https://github.com/golangci/golangci-lint/releases/download/v${versionWithoutV}/golangci-lint-${versionWithoutV}-linux-${arch}.tar.gz`,
146151
})
147152
})
148153
}

0 commit comments

Comments
 (0)