From f2fe889a7c7dbba6e633ca3c9ddce3c8a35efc5e Mon Sep 17 00:00:00 2001 From: yisier <1340976576@qq.com> Date: Sun, 12 Jul 2026 22:17:54 -0600 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E6=89=93=E5=8C=85=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BB=8E=20tar.gz=20=E6=94=B9=E4=B8=BA=20zip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 70 +++++++++++++++++----------------- .travis.yml | 66 ++++++++++++++++---------------- build.assets.sh | 72 +++++++++++++++++------------------ build.sh | 72 +++++++++++++++++------------------ lib/install/install.go | 13 ++----- 5 files changed, 144 insertions(+), 149 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17fd9ac..f93431a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,41 +40,41 @@ jobs: if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' with: files: | - freebsd_386_client.tar.gz - freebsd_386_server.tar.gz - freebsd_amd64_client.tar.gz - freebsd_amd64_server.tar.gz - freebsd_arm_client.tar.gz - freebsd_arm_server.tar.gz - linux_386_client.tar.gz - linux_386_server.tar.gz - linux_amd64_client.tar.gz - linux_amd64_server.tar.gz - linux_arm64_client.tar.gz - linux_arm64_server.tar.gz - linux_arm_v5_client.tar.gz - linux_arm_v6_client.tar.gz - linux_arm_v7_client.tar.gz - linux_arm_v5_server.tar.gz - linux_arm_v6_server.tar.gz - linux_arm_v7_server.tar.gz - linux_mips64le_client.tar.gz - linux_mips64le_server.tar.gz - linux_mips64_client.tar.gz - linux_mips64_server.tar.gz - linux_mipsle_client.tar.gz - linux_mipsle_server.tar.gz - linux_mips_client.tar.gz - linux_mips_server.tar.gz - darwin_amd64_client.tar.gz - darwin_amd64_server.tar.gz - darwin_arm64_client.tar.gz - darwin_arm64_server.tar.gz - windows_386_client.tar.gz - windows_386_server.tar.gz - windows_amd64_client.tar.gz - windows_amd64_server.tar.gz - npc_sdk.tar.gz + freebsd_386_client.zip + freebsd_386_server.zip + freebsd_amd64_client.zip + freebsd_amd64_server.zip + freebsd_arm_client.zip + freebsd_arm_server.zip + linux_386_client.zip + linux_386_server.zip + linux_amd64_client.zip + linux_amd64_server.zip + linux_arm64_client.zip + linux_arm64_server.zip + linux_arm_v5_client.zip + linux_arm_v6_client.zip + linux_arm_v7_client.zip + linux_arm_v5_server.zip + linux_arm_v6_server.zip + linux_arm_v7_server.zip + linux_mips64le_client.zip + linux_mips64le_server.zip + linux_mips64_client.zip + linux_mips64_server.zip + linux_mipsle_client.zip + linux_mipsle_server.zip + linux_mips_client.zip + linux_mips_server.zip + darwin_amd64_client.zip + darwin_amd64_server.zip + darwin_arm64_client.zip + darwin_arm64_server.zip + windows_386_client.zip + windows_386_server.zip + windows_amd64_client.zip + windows_amd64_server.zip + npc_sdk.zip tag_name: ${{ github.ref_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml index eb8c5bb..de2268a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,40 +17,40 @@ deploy: token: ${GH_TOKEN} cleanup: false file: - - freebsd_386_client.tar.gz - - freebsd_386_server.tar.gz - - freebsd_amd64_client.tar.gz - - freebsd_amd64_server.tar.gz - - freebsd_arm_client.tar.gz - - freebsd_arm_server.tar.gz - - linux_386_client.tar.gz - - linux_386_server.tar.gz - - linux_amd64_client.tar.gz - - linux_amd64_server.tar.gz - - linux_arm64_client.tar.gz - - linux_arm64_server.tar.gz - - linux_arm_v5_client.tar.gz - - linux_arm_v6_client.tar.gz - - linux_arm_v7_client.tar.gz - - linux_arm_v5_server.tar.gz - - linux_arm_v6_server.tar.gz - - linux_arm_v7_server.tar.gz - - linux_mips64le_client.tar.gz - - linux_mips64le_server.tar.gz - - linux_mips64_client.tar.gz - - linux_mips64_server.tar.gz - - linux_mipsle_client.tar.gz - - linux_mipsle_server.tar.gz - - linux_mips_client.tar.gz - - linux_mips_server.tar.gz - - darwin_amd64_client.tar.gz - - darwin_amd64_server.tar.gz - - windows_386_client.tar.gz - - windows_386_server.tar.gz - - windows_amd64_client.tar.gz - - windows_amd64_server.tar.gz + - freebsd_386_client.zip + - freebsd_386_server.zip + - freebsd_amd64_client.zip + - freebsd_amd64_server.zip + - freebsd_arm_client.zip + - freebsd_arm_server.zip + - linux_386_client.zip + - linux_386_server.zip + - linux_amd64_client.zip + - linux_amd64_server.zip + - linux_arm64_client.zip + - linux_arm64_server.zip + - linux_arm_v5_client.zip + - linux_arm_v6_client.zip + - linux_arm_v7_client.zip + - linux_arm_v5_server.zip + - linux_arm_v6_server.zip + - linux_arm_v7_server.zip + - linux_mips64le_client.zip + - linux_mips64le_server.zip + - linux_mips64_client.zip + - linux_mips64_server.zip + - linux_mipsle_client.zip + - linux_mipsle_server.zip + - linux_mips_client.zip + - linux_mips_server.zip + - darwin_amd64_client.zip + - darwin_amd64_server.zip + - windows_386_client.zip + - windows_386_server.zip + - windows_amd64_client.zip + - windows_amd64_server.zip - npc_syno.spk - - npc_sdk.tar.gz + - npc_sdk.zip - android_client.apk on: tags: true diff --git a/build.assets.sh b/build.assets.sh index 23ff542..f4000c2 100755 --- a/build.assets.sh +++ b/build.assets.sh @@ -1,167 +1,167 @@ export GOPROXY=direct sudo apt-get update -sudo apt-get install gcc-mingw-w64-i686 gcc-multilib +sudo apt-get install -y gcc-mingw-w64-i686 gcc-multilib zip env GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc go build -ldflags "-s -w -extldflags -static -extldflags -static" -buildmode=c-shared -o npc_sdk.dll cmd/npc/sdk.go env GOOS=linux GOARCH=386 CGO_ENABLED=1 CC=gcc go build -ldflags "-s -w -extldflags -static -extldflags -static" -buildmode=c-shared -o npc_sdk.so cmd/npc/sdk.go -tar -czvf npc_sdk.tar.gz npc_sdk.dll npc_sdk.so npc_sdk.h +zip -r npc_sdk.zip npc_sdk.dll npc_sdk.so npc_sdk.h CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_amd64_client.tar.gz npc +zip -r linux_amd64_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_386_client.tar.gz npc +zip -r linux_386_client.zip npc CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf freebsd_386_client.tar.gz npc +zip -r freebsd_386_client.zip npc CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf freebsd_amd64_client.tar.gz npc +zip -r freebsd_amd64_client.zip npc CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf freebsd_arm_client.tar.gz npc +zip -r freebsd_arm_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_arm_v7_client.tar.gz npc +zip -r linux_arm_v7_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_arm_v6_client.tar.gz npc +zip -r linux_arm_v6_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_arm_v5_client.tar.gz npc +zip -r linux_arm_v5_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_arm64_client.tar.gz npc +zip -r linux_arm64_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_mips64_client.tar.gz npc +zip -r linux_mips64_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=mips64le GOMIPS64=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_mips64le_client.tar.gz npc +zip -r linux_mips64le_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_mipsle_client.tar.gz npc +zip -r linux_mipsle_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=mips GOMIPS=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_mips_client.tar.gz npc +zip -r linux_mips_client.zip npc CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf windows_386_client.tar.gz npc.exe +zip -r windows_386_client.zip npc.exe CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf windows_amd64_client.tar.gz npc.exe +zip -r windows_amd64_client.zip npc.exe CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf darwin_amd64_client.tar.gz npc +zip -r darwin_amd64_client.zip npc CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf darwin_arm64_client.tar.gz npc +zip -r darwin_arm64_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_amd64_server.tar.gz nps +zip -r linux_amd64_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_386_server.tar.gz nps +zip -r linux_386_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_arm_v5_server.tar.gz nps +zip -r linux_arm_v5_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_arm_v6_server.tar.gz nps +zip -r linux_arm_v6_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_arm_v7_server.tar.gz nps +zip -r linux_arm_v7_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_arm64_server.tar.gz nps +zip -r linux_arm64_server.zip nps CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf freebsd_arm_server.tar.gz nps +zip -r freebsd_arm_server.zip nps CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf freebsd_386_server.tar.gz nps +zip -r freebsd_386_server.zip nps CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf freebsd_amd64_server.tar.gz nps +zip -r freebsd_amd64_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=mips GOMIPS=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_mips_server.tar.gz nps +zip -r linux_mips_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_mips64_server.tar.gz nps +zip -r linux_mips64_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=mips64le GOMIPS64=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_mips64le_server.tar.gz nps +zip -r linux_mips64le_server.zip nps CGO_ENABLED=0 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_mipsle_server.tar.gz nps +zip -r linux_mipsle_server.zip nps CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf darwin_amd64_server.tar.gz nps +zip -r darwin_amd64_server.zip nps CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf darwin_arm64_server.tar.gz nps +zip -r darwin_arm64_server.zip nps CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf windows_amd64_server.tar.gz nps.exe +zip -r windows_amd64_server.zip nps.exe CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf windows_386_server.tar.gz nps.exe \ No newline at end of file +zip -r windows_386_server.zip nps.exe \ No newline at end of file diff --git a/build.sh b/build.sh index aeae763..bf2a805 100755 --- a/build.sh +++ b/build.sh @@ -3,149 +3,149 @@ export VERSION=0.26.33 export GOPROXY=direct sudo apt-get update -sudo apt-get install gcc-mingw-w64-i686 gcc-multilib +sudo apt-get install -y gcc-mingw-w64-i686 gcc-multilib zip env GOOS=windows GOARCH=386 CGO_ENABLED=1 CC=i686-w64-mingw32-gcc go build -ldflags "-s -w -extldflags -static -extldflags -static" -buildmode=c-shared -o npc_sdk.dll cmd/npc/sdk.go env GOOS=linux GOARCH=386 CGO_ENABLED=1 CC=gcc go build -ldflags "-s -w -extldflags -static -extldflags -static" -buildmode=c-shared -o npc_sdk.so cmd/npc/sdk.go -tar -czvf npc_sdk.tar.gz npc_sdk.dll npc_sdk.so npc_sdk.h +zip -r npc_sdk.zip npc_sdk.dll npc_sdk.so npc_sdk.h wget https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz tar -xvf upx-3.95-amd64_linux.tar.xz cp upx-3.95-amd64_linux/upx ./ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_amd64_client.tar.gz npc +zip -r linux_amd64_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_386_client.tar.gz npc +zip -r linux_386_client.zip npc CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf freebsd_386_client.tar.gz npc +zip -r freebsd_386_client.zip npc CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf freebsd_amd64_client.tar.gz npc +zip -r freebsd_amd64_client.zip npc CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf freebsd_arm_client.tar.gz npc +zip -r freebsd_arm_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_arm_v7_client.tar.gz npc +zip -r linux_arm_v7_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_arm_v6_client.tar.gz npc +zip -r linux_arm_v6_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_arm_v5_client.tar.gz npc +zip -r linux_arm_v5_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_arm64_client.tar.gz npc +zip -r linux_arm64_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_mips64_client.tar.gz npc +zip -r linux_mips64_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=mips64le GOMIPS64=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_mips64le_client.tar.gz npc +zip -r linux_mips64le_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_mipsle_client.tar.gz npc +zip -r linux_mipsle_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=mips GOMIPS=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf linux_mips_client.tar.gz npc +zip -r linux_mips_client.zip npc CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf windows_386_client.tar.gz npc.exe +zip -r windows_386_client.zip npc.exe CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf windows_amd64_client.tar.gz npc.exe +zip -r windows_amd64_client.zip npc.exe CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf darwin_amd64_client.tar.gz npc +zip -r darwin_amd64_client.zip npc CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/npc/npc.go -tar -czvf darwin_arm64_client.tar.gz npc +zip -r darwin_arm64_client.zip npc CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_amd64_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_386_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_arm_v5_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_arm_v5_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_arm_v6_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_arm_v6_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_arm_v7_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_arm_v7_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_arm64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_arm64_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=freebsd GOARCH=arm go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf freebsd_arm_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r freebsd_arm_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=freebsd GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf freebsd_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r freebsd_386_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf freebsd_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r freebsd_amd64_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=mips GOMIPS=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_mips_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_mips_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=mips64 GOMIPS64=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_mips64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_mips64_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=mips64le GOMIPS64=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_mips64le_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_mips64le_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf linux_mipsle_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r linux_mipsle_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf darwin_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r darwin_amd64_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf darwin_arm64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps +zip -r darwin_arm64_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf windows_amd64_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps.exe +zip -r windows_amd64_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps.exe CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags "-s -w -extldflags -static -extldflags -static" ./cmd/nps/nps.go -tar -czvf windows_386_server.tar.gz conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps.exe +zip -r windows_386_server.zip conf/nps.conf conf/tasks.json conf/clients.json conf/hosts.json conf/server.key conf/server.pem web/views web/static nps.exe curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" diff --git a/lib/install/install.go b/lib/install/install.go index 05bc066..8232155 100644 --- a/lib/install/install.go +++ b/lib/install/install.go @@ -232,7 +232,7 @@ func downloadLatest(bin string) string { json.Unmarshal(b, &rl) version := rl.TagName fmt.Println("the latest version is", version) - filename := runtime.GOOS + "_" + runtime.GOARCH + "_" + bin + ".tar.gz" + filename := runtime.GOOS + "_" + runtime.GOARCH + "_" + bin + ".zip" // download latest package downloadUrl := fmt.Sprintf("https://github.com/yisier/nps/releases/download/%s/%s", version, filename) fmt.Println("download package from ", downloadUrl) @@ -270,7 +270,7 @@ func downloadLatest2(bin string, path string) string { json.Unmarshal(b, &rl) version := rl.TagName fmt.Println("the latest version is", version) - filename := runtime.GOOS + "_" + runtime.GOARCH + "_" + bin + ".tar.gz" + filename := runtime.GOOS + "_" + runtime.GOARCH + "_" + bin + ".zip" // download latest package downloadUrl := fmt.Sprintf("https://github.com/yisier/nps/releases/download/%s/%s", version, filename) fmt.Println("download package from ", downloadUrl) @@ -301,17 +301,12 @@ func copyStaticFile(srcPath, bin string) string { if _, err := copyFile(filepath.Join(srcPath, bin), "/usr/local/bin/"+bin); err != nil { log.Fatalln(err) } else { - copyFile(filepath.Join(srcPath, bin), "/usr/local/bin/"+bin+"-update") - chMod("/usr/local/bin/"+bin+"-update", 0755) binPath = "/usr/local/bin/" + bin } } else { - copyFile(filepath.Join(srcPath, bin), "/usr/bin/"+bin+"-update") - chMod("/usr/bin/"+bin+"-update", 0755) binPath = "/usr/bin/" + bin } } else { - copyFile(filepath.Join(srcPath, bin+".exe"), filepath.Join(common.GetAppPath(), bin+"-update.exe")) copyFile(filepath.Join(srcPath, bin+".exe"), filepath.Join(common.GetAppPath(), bin+".exe")) } chMod(binPath, 0755) @@ -371,11 +366,11 @@ func InstallNps() string { log.Println("The new configuration file is located in", path, "you can edit them") if !common.IsWindows() { log.Println(`You can start with: -nps start|stop|restart|uninstall|update or nps-update update +nps start|stop|restart|uninstall|update anywhere!`) } else { log.Println(`You can copy executable files to any directory and start working with: -nps.exe start|stop|restart|uninstall|update or nps-update.exe update +nps.exe start|stop|restart|uninstall|update now!`) } chMod(common.GetLogPath(), 0777)