-
Notifications
You must be signed in to change notification settings - Fork 13
/
release.sh
executable file
·58 lines (50 loc) · 1.98 KB
/
release.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#https://gist.github.com/bclinkinbeard/1331790
versionLabel=$1
productName="goDashing"
releaseFolder="release/"
rm ${releaseFolder}*.tgz
rm ${releaseFolder}*.zip
rice embed-go
arch=amd64
os=windows
product=${productName}_${versionLabel}_${os}_${arch}
env GOOS=$os GOARCH=$arch go build -ldflags="-s -w -X main.version=${1} -X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` " -o ${product}.exe cmd/main.go
zip -r ${product}.zip ${product}.exe
rm $product.exe
mv $product.zip ${releaseFolder}/
arch=amd64
os=darwin
product=${productName}_${versionLabel}_${os}_${arch}
env GOOS=$os GOARCH=$arch go build -ldflags="-s -w -X main.version=${1} -X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` " -o $product cmd/main.go
tar czfv $product.tgz $product
rm $product
mv $product.tgz ${releaseFolder}/
arch=arm
os=linux
product=${productName}_${versionLabel}_${os}_${arch}
env GOOS=$os GOARCH=$arch go build -ldflags="-s -w -X main.version=${1} -X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` " -o $product cmd/main.go
tar czfv $product.tgz $product
rm $product
mv $product.tgz ${releaseFolder}/
arch=amd64
os=linux
product=${productName}_${versionLabel}_${os}_${arch}
env GOOS=$os GOARCH=$arch go build -ldflags="-s -w -X main.version=${1} -X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` " -o $product cmd/main.go
tar czfv $product.tgz $product
rm $product
mv $product.tgz ${releaseFolder}/
arch=386
os=linux
product=${productName}_${versionLabel}_${os}_${arch}
env GOOS=$os GOARCH=$arch go build -ldflags="-s -w -X main.version=${1} -X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` " -o $product cmd/main.go
tar czfv $product.tgz $product
rm $product
mv $product.tgz ${releaseFolder}/
arch=386
os=windows
product=${productName}_${versionLabel}_${os}_${arch}
env GOOS=$os GOARCH=$arch go build -ldflags="-s -w -X main.version=${1} -X main.buildstamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` " -o ${product}.exe cmd/main.go
zip -r ${product}.zip ${product}.exe
rm $product.exe
mv $product.zip ${releaseFolder}/