14 Star 58 Fork 24

Gitee 极速下载 / Pingtunnel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/esrrhs/pingtunnel
克隆/下载
pack.sh 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
shitfuck 提交于 2023-11-29 11:52 . update
#! /bin/bash
#set -x
NAME="pingtunnel"
export GO111MODULE=on
#go tool dist list
build_list=$(go tool dist list)
go mod tidy
cd cmd/
rm pack -rf
rm pack.zip -f
mkdir pack
for line in $build_list; do
os=$(echo "$line" | awk -F"/" '{print $1}')
arch=$(echo "$line" | awk -F"/" '{print $2}')
echo "os="$os" arch="$arch" start build"
if [ $os == "android" ]; then
continue
fi
if [ $os == "ios" ]; then
continue
fi
if [ $arch == "wasm" ]; then
continue
fi
CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -ldflags="-s -w"
if [ $? -ne 0 ]; then
echo "os="$os" arch="$arch" build fail"
exit 1
fi
if [ $os = "windows" ]; then
mv cmd.exe ${NAME}.exe
zip ${NAME}_"${os}"_"${arch}"".zip" ${NAME}.exe
if [ $? -ne 0 ]; then
echo "os="$os" arch="$arch" zip fail"
exit 1
fi
mv ${NAME}_"${os}"_"${arch}"".zip" pack/
rm $NAME".exe" -f
else
mv cmd ${NAME}
zip ${NAME}_"${os}"_"${arch}"".zip" ${NAME}
if [ $? -ne 0 ]; then
echo "os="$os" arch="$arch" zip fail"
exit 1
fi
mv ${NAME}_"${os}"_"${arch}"".zip" pack/
rm $NAME -f
fi
echo "os="$os" arch="$arch" done build"
done
zip pack.zip pack/ -r
echo "all done"
1
https://gitee.com/mirrors/Pingtunnel.git
git@gitee.com:mirrors/Pingtunnel.git
mirrors
Pingtunnel
Pingtunnel
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891