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