-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·50 lines (36 loc) · 1.09 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
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` <tag>"
exit 65
fi
TAG=$1
# Tag & build master branch
git checkout master
git tag ${TAG}
box build
# Copy executable file into GH pages
git checkout gh-pages
cp probuild.phar downloads/probuild-${TAG}.phar
git add downloads/probuild-${TAG}.phar
SHA1=$(openssl sha1 probuild.phar)
JSON='name:"probuild.phar"'
JSON="${JSON},sha1:\"${SHA1}\""
JSON="${JSON},url:\"http://cristian-quiroz.github.io/probuild/downloads/probuild-${TAG}.phar\""
JSON="${JSON},version:\"${TAG}\""
if [ -f probuild.phar.pubkey ]; then
cp probuild.phar.pubkey pubkeys/probuild-${TAG}.phar.pubkeys
git add pubkeys/probuild-${TAG}.phar.pubkeys
JSON="${JSON},publicKey:\"http://cristian-quiroz.github.io/probuild/pubkeys/probuild-${TAG}.phar.pubkey\""
fi
# Update manifest
cat manifest.json | jsawk -a "this.push({${JSON}})" | python -mjson.tool > manifest.json.tmp
mv manifest.json.tmp manifest.json
git add manifest.json
git commit -m "Bump version ${TAG}"
# Go back to master
git checkout master
git push origin gh-pages
git push ${TAG}
echo "Done."
#