mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-14 23:11:14 +00:00
feat: allow linux arm64
This commit is contained in:
parent
d4917a53ab
commit
8f54e75cd1
4 changed files with 18425 additions and 99 deletions
9257
dist/post_run/index.js
generated
vendored
9257
dist/post_run/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
9257
dist/run/index.js
generated
vendored
9257
dist/run/index.js
generated
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -22,6 +22,9 @@ const getAssetURL = (versionConfig: VersionConfig): string => {
|
||||||
}
|
}
|
||||||
let arch = os.arch()
|
let arch = os.arch()
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
|
case "arm64":
|
||||||
|
arch = "arm64"
|
||||||
|
break
|
||||||
case "x64":
|
case "x64":
|
||||||
arch = "amd64"
|
arch = "amd64"
|
||||||
break
|
break
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import * as core from "@actions/core"
|
import * as core from "@actions/core"
|
||||||
import * as httpm from "@actions/http-client"
|
import * as httpm from "@actions/http-client"
|
||||||
import * as fs from "fs"
|
import * as fs from "fs"
|
||||||
|
import os from "os"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
|
|
||||||
import { InstallMode } from "./install"
|
import { InstallMode } from "./install"
|
||||||
|
|
@ -139,10 +140,14 @@ export async function findLintVersion(mode: InstallMode): Promise<VersionConfig>
|
||||||
// if the patched version is passed, just use it
|
// if the patched version is passed, just use it
|
||||||
if (reqLintVersion?.major !== null && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) {
|
if (reqLintVersion?.major !== null && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
|
let arch: string = "amd64"
|
||||||
|
if (os.arch() === "arm64") {
|
||||||
|
arch = "arm64"
|
||||||
|
}
|
||||||
const versionWithoutV = `${reqLintVersion.major}.${reqLintVersion.minor}.${reqLintVersion.patch}`
|
const versionWithoutV = `${reqLintVersion.major}.${reqLintVersion.minor}.${reqLintVersion.patch}`
|
||||||
resolve({
|
resolve({
|
||||||
TargetVersion: `v${versionWithoutV}`,
|
TargetVersion: `v${versionWithoutV}`,
|
||||||
AssetURL: `https://github.com/golangci/golangci-lint/releases/download/v${versionWithoutV}/golangci-lint-${versionWithoutV}-linux-amd64.tar.gz`,
|
AssetURL: `https://github.com/golangci/golangci-lint/releases/download/v${versionWithoutV}/golangci-lint-${versionWithoutV}-linux-${arch}.tar.gz`,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue