1
+ #! /usr/bin/env bash
2
+
3
+ # STEPS TO PERFORM RELEASE
4
+ #
5
+ # 1) ensure a new tag exists on github:
6
+ # git tag -a 2016.12.03
7
+ #
8
+ # 2) update the "name" param in release below and any description
9
+ # these are PER RELEASE
10
+ #
11
+ # 3) run release.sh
12
+ #
13
+ # https://github.com/aktau/github-release
14
+ #
15
+ # expects GITHUB_TOKEN in env
16
+ #
17
+
18
+
19
+ # show info on current release
20
+ # github-release info -u dataux -r dataux
21
+
22
+ export GITHUB_USER=" dataux"
23
+ export GITHUB_REPO=" dataux"
24
+
25
+ cd $GOPATH /src/github.com/dataux/dataux
26
+
27
+ dorelease () {
28
+ echo " releasing $TAG "
29
+
30
+ # if we are re-running, lets delete it first
31
+ github-release delete --tag $TAG
32
+
33
+ # create a release for tag
34
+ github-release release \
35
+ --tag $TAG \
36
+ --name " Dataux $TAG release" \
37
+ --description "
38
+ download and save the binary and rename to dataux
39
+
40
+ \`\`\`
41
+ # linux/amd64
42
+ curl -Lo dataux https://github.com/dataux/dataux/releases/download/$TAG /dataux_linux.$TAG && chmod +x dataux && sudo mv dataux /usr/local/bin/
43
+
44
+ # OS X/amd64
45
+ curl -Lo dataux https://github.com/dataux/dataux/releases/download/$TAG /dataux_mac.$TAG && chmod +x dataux && sudo mv dataux /usr/local/bin/
46
+
47
+ \`\`\`
48
+ "
49
+
50
+ # https://github.com/dataux/dataux/releases/download/2016.12.03/dataux_linux.2016.12.03
51
+
52
+ # do the linux release
53
+ echo " Creating and uploading linux dataux"
54
+ go build
55
+
56
+ echo " Now uploading $TAG linux version"
57
+ github-release upload \
58
+ --tag $TAG \
59
+ --label " Dataux linux $TAG " \
60
+ --name " dataux_linux.$TAG " \
61
+ --file dataux
62
+
63
+ # create a build for the mac osx amd64 binary
64
+ echo " Creating and uploading mac dataux"
65
+ env GOOS=darwin GOARCH=amd64 go build
66
+
67
+ echo " Now uploading $TAG mac version"
68
+ github-release upload \
69
+ --tag $TAG \
70
+ --label " Dataux mac $TAG " \
71
+ --name " dataux_mac.$TAG " \
72
+ --file dataux
73
+
74
+ }
75
+
76
+ # lets get the name of this release which is our tag
77
+ # aka 2016.12.03 type tag
78
+ export TAG=$( git describe $( git rev-list --tags --max-count=1) )
79
+ dorelease
80
+
81
+ export TAG=" latest"
82
+ dorelease
0 commit comments