-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·24 lines (19 loc) · 959 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
version=$(git describe --tags)
buildTime=$(date '+%Y-%m-%d %H:%M:%S')
echo version:$version
echo buildTime:$buildTime
argsVersion="main.Version=$version"
argsBuildTime="main.BuildTime=$buildTime"
env GOOS=linux GOARCH=arm go build -o out/myddns_arm -mod=vendor -ldflags="-X '$argsVersion' \
-X '$argsBuildTime'"
env GOOS=linux GOARCH=arm64 go build -o out/myddns_arm64 -mod=vendor -ldflags="-X '$argsVersion' \
-X '$argsBuildTime' "
env GOOS=linux GOARCH=amd64 go build -o out/myddns_amd64 -mod=vendor -ldflags="-X '$argsVersion' \
-X '$argsBuildTime' "
env GOOS=linux GOARCH=386 go build -o out/myddns_386 -mod=vendor -ldflags="-X '$argsVersion' \
-X '$argsBuildTime' "
env GOOS=windows GOARCH=386 go build -o out/myddns_windows_386 -mod=vendor -ldflags="-X '$argsVersion' \
-X '$argsBuildTime' "
env GOOS=windows GOARCH=amd64 go build -o out/myddns_windows_amd64 -mod=vendor -ldflags="-X '$argsVersion' \
-X '$argsBuildTime' "