13 Star 93 Fork 39

赵建辉 / rttys

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.sh 529 Bytes
一键复制 编辑 原始数据 按行查看 历史
赵建辉 提交于 2022-05-02 23:55 . feat: support build statically
#!/bin/sh
VersionPath="rttys/version"
GitCommit=$(git log --pretty=format:"%h" -1)
BuildTime=$(date +%FT%T%z)
[ $# -lt 2 ] && {
echo "Usage: $0 linux amd64"
exit 1
}
generate() {
local os="$1"
local arch="$2"
local dir="rttys-$os-$arch"
local bin="rttys"
rm -rf $dir
mkdir $dir
cp rttys.conf $dir
[ "$os" = "windows" ] && {
bin="rttys.exe"
}
GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -ldflags="-s -w -X $VersionPath.gitCommit=$GitCommit -X $VersionPath.buildTime=$BuildTime" -o $dir/$bin
}
generate $1 $2
Go
1
https://gitee.com/zhaojh329/rttys.git
git@gitee.com:zhaojh329/rttys.git
zhaojh329
rttys
rttys
master

搜索帮助