From a203580ecf064129995f12f4711cd7d68a6a3949 Mon Sep 17 00:00:00 2001 From: naiba Date: Mon, 21 Dec 2020 19:14:50 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(agent):=20ARM=20=E5=AE=9E?= =?UTF-8?q?=E9=AA=8C=E6=80=A7=E6=94=AF=E6=8C=81-=E6=9C=AA=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .goreleaser.yml | 22 ++++++++++++++++++++++ script/install.sh | 14 ++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 51b9751..67b7dc8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,6 +9,28 @@ builds: - linux - windows - darwin + goarch: + - amd64 + - arm64 + - 386 + - arm + - mips + - mips64 + ignore: + - goos: darwin + goarch: 386 + - goos: darwin + goarch: arm + - goos: darwin + goarch: mips + - goos: darwin + goarch: mips64 + - goos: windows + goarch: arm + - goos: windows + goarch: mips + - goos: windows + goarch: mips64 main: ./cmd/agent binary: nezha-agent checksum: diff --git a/script/install.sh b/script/install.sh index 11376a6..edb1202 100755 --- a/script/install.sh +++ b/script/install.sh @@ -75,10 +75,20 @@ pre_check() { fi ## os_arch - if [ $(uname -m | grep '64') != "" ]; then + if [ $(uname -m | grep 'x86_64') != "" ]; then os_arch="amd64" - else + elif [ $(uname -m | grep 'i686') != "" ]; then + os_arch="amd64" + elif [ $(uname -m | grep 'i386') != "" ]; then os_arch="386" + elif [ $(uname -m | grep 'aarch64') != "" ]; then + os_arch="arm64" + elif [ $(uname -m | grep 'armv8b') != "" ]; then + os_arch="arm64" + elif [ $(uname -m | grep 'armv8l') != "" ]; then + os_arch="arm64" + elif [ $(uname -m | grep 'arm') != "" ]; then + os_arch="arm" fi ## server location