Skip to content

Commit

Permalink
feat: arm64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim authored and guiyomh committed Nov 28, 2023
1 parent 399e094 commit d85f1c5
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/golangci-lint/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,26 @@ check_packages curl ca-certificates
# Soft version matching
find_version_from_git_tags GOLANGCI_VERSION "https://github.com/golangci/golangci-lint" "tags/v" "." "true"

ARCH=$(uname -m)
if [[ "$ARCH" == "aarch64" ]]; then
ARCH="arm64"
else
ARCH="amd64"
fi

case "${ID}" in
debian|ubuntu)
curl -sL -o /tmp/golangci-lint.deb "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-amd64.deb"
ARCH=$(dpkg --print-architecture)
curl -sL -o /tmp/golangci-lint.deb "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-${ARCH}.deb"
dpkg -i /tmp/golangci-lint.deb
rm -rf /tmp/golangci-lint.deb
;;
alpine)
curl -sL -o /tmp/golangci-lint.tar.gz "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-amd64.tar.gz"
tar xvf /tmp/golangci-lint.tar.gz "golangci-lint-${GOLANGCI_VERSION}-linux-amd64/golangci-lint"
ls -la "golangci-lint-${GOLANGCI_VERSION}-linux-amd64/"
mv "golangci-lint-${GOLANGCI_VERSION}-linux-amd64/golangci-lint" /usr/local/bin/golangci-lint
rm -rf /tmp/golangci-lint.tar.gz "golangci-lint-${GOLANGCI_VERSION}-linux-amd64/"
curl -sL -o /tmp/golangci-lint.tar.gz "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCI_VERSION}/golangci-lint-${GOLANGCI_VERSION}-linux-${ARCH}.tar.gz"
tar xvf /tmp/golangci-lint.tar.gz "golangci-lint-${GOLANGCI_VERSION}-linux-${ARCH}/golangci-lint"
ls -la "golangci-lint-${GOLANGCI_VERSION}-linux-${ARCH}/"
mv "golangci-lint-${GOLANGCI_VERSION}-linux-${ARCH}/golangci-lint" /usr/local/bin/golangci-lint
rm -rf /tmp/golangci-lint.tar.gz "golangci-lint-${GOLANGCI_VERSION}-linux-${ARCH}/"
;;
esac

Expand Down

0 comments on commit d85f1c5

Please sign in to comment.