-
Notifications
You must be signed in to change notification settings - Fork 6
/
release.sh
executable file
·59 lines (40 loc) · 1.8 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
59
#!/bin/bash
set -ex
# Update resouyrce bundles
date +%s > res/resources_version.txt
go-bindata -pkg core -o core/resources_gen.go res/...
# Validate build
go test ./...
go build ./...
# Create git release branch
git status
echo "Continue ?"
read should_continue
echo "Version (ie: 0.0.3)?"
read version
git checkout -b release_$version
echo -e "package core\n\nconst Version = \"$version\"\n" > core/version.go
git add core/version.go core/resources_gen.go res/resources_version.txt
git commit -m "Release $version"
git push origin release_$version
echo "Pushed branch release_$version to github, merge ready !"
# cross compile binaries
cd cmd/goed/
gox -osarch="darwin/amd64 darwin/386 linux/amd64 linux/386 linux/arm"\
-output="/tmp/goed/${version}/{{.OS}}/{{.Arch}}/goed"
cd -
# Publish to bintray
echo "publish to bintray ?"
read should_publish
curl -T /tmp/goed/$version/linux/amd64/goed -utcolar:$BINTRAY_KEY -H "X-Bintray-Version:$version"\
https://api.bintray.com/content/tcolar/Goed/Goed/$version/linux_amd64/goed
curl -T /tmp/goed/$version/linux/386/goed -utcolar:$BINTRAY_KEY -H "X-Bintray-Version:$version"\
https://api.bintray.com/content/tcolar/Goed/Goed/$version/linux_386/goed
curl -T /tmp/goed/$version/linux/arm/goed -utcolar:$BINTRAY_KEY -H "X-Bintray-Version:$version"\
https://api.bintray.com/content/tcolar/Goed/Goed/$version/linux_arm/goed
curl -T /tmp/goed/$version/darwin/amd64/goed -utcolar:$BINTRAY_KEY -H "X-Bintray-Version:$version"\
https://api.bintray.com/content/tcolar/Goed/Goed/$version/darwin_amd64/goed
curl -T /tmp/goed/$version/darwin/386/goed -utcolar:$BINTRAY_KEY -H "X-Bintray-Version:$version"\
https://api.bintray.com/content/tcolar/Goed/Goed/$version/darwin_386/goed
curl -X POST -utcolar:$BINTRAY_KEY\
https://api.bintray.com/content/tcolar/Goed/Goed/$version/publish