Skip to content

Commit

Permalink
feat: support linux arm64 public preview (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Jan 16, 2025
1 parent a0297a1 commit ec5d184
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-latest
- windows-latest
version:
Expand Down Expand Up @@ -75,6 +76,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-latest
- windows-latest
version:
Expand Down Expand Up @@ -104,6 +106,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
Expand Down
10 changes: 9 additions & 1 deletion dist/post_run/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion dist/run/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const getAssetURL = (versionConfig: VersionConfig): string => {
}
let arch = os.arch()
switch (arch) {
case "arm64":
arch = "arm64"
break
case "x64":
arch = "amd64"
break
Expand Down
7 changes: 6 additions & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as core from "@actions/core"
import * as httpm from "@actions/http-client"
import * as fs from "fs"
import os from "os"
import path from "path"

import { InstallMode } from "./install"
Expand Down Expand Up @@ -139,10 +140,14 @@ export async function findLintVersion(mode: InstallMode): Promise<VersionConfig>
// if the patched version is passed, just use it
if (reqLintVersion?.major !== null && reqLintVersion?.minor != null && reqLintVersion?.patch !== null) {
return new Promise((resolve) => {
let arch: string = "amd64"
if (os.arch() === "arm64") {
arch = "arm64"
}
const versionWithoutV = `${reqLintVersion.major}.${reqLintVersion.minor}.${reqLintVersion.patch}`
resolve({
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`,
})
})
}
Expand Down

0 comments on commit ec5d184

Please # to comment.