From 7644978e23646fdf59c2c043f768635356309329 Mon Sep 17 00:00:00 2001 From: giaogiao Date: Wed, 13 Sep 2023 10:05:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=85=B6=E4=BB=96=E6=9E=B6=E6=9E=84=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 5 +---- README.md | 0 bulid.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 README.md create mode 100644 bulid.sh diff --git a/.drone.yml b/.drone.yml index 7897a5f..a7250ce 100644 --- a/.drone.yml +++ b/.drone.yml @@ -43,10 +43,7 @@ steps: - sed -i 's?/favicon.ico?/static/favicon.ico?g' ./app/index.html - sed -i 's?/logo192.png?/static/logo192.png?g' ./app/index.html - sed -i 's?/manifest.json?/static/manifest.json?g' ./app/index.html - - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o /root/web/windows_amd64_main.exe - - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o /root/web/linux_arm64_main - - CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o /root/web/linux_arm_main - - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /root/web/linux_amd64_main + - bash bulid.sh volumes: - name: outdir host: diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/bulid.sh b/bulid.sh new file mode 100644 index 0000000..843cbfe --- /dev/null +++ b/bulid.sh @@ -0,0 +1,45 @@ +#!/bin/bash +CPU_architecture="darwin/amd64 +darwin/arm64 +freebsd/386 +freebsd/amd64 +freebsd/arm +freebsd/arm64 +linux/386 +linux/amd64 +linux/arm +linux/arm64 +linux/loong64 +linux/mips +linux/mips64 +linux/mips64le +linux/mipsle +linux/ppc64 +linux/ppc64le +linux/riscv64 +linux/s390x +netbsd/386 +netbsd/amd64 +netbsd/arm +netbsd/arm64 +openbsd/386 +openbsd/amd64 +openbsd/arm +openbsd/arm64 +openbsd/mips64 +windows/386 +windows/amd64 +windows/arm +windows/arm64" + +for line in $CPU_architecture +do + array=(${line//\// }) + extension="" + if [ "${array[0]}" == "windows" ];then + extension=".exe" + fi + echo "Start compiling the system:${array[0]} architecture:${array[1]}" + # echo "CGO_ENABLED=0 GOOS=${array[0]} GOARCH=${array[1]} go build -o /root/web/${array[0]}_${array[1]}_main${extension}" + CGO_ENABLED=0 GOOS=${array[0]} GOARCH=${array[1]} go build -o /root/web/${array[0]}_${array[1]}_main${extension} +done