forked from facesea/banshee
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.sh
executable file
·30 lines (30 loc) · 940 Bytes
/
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
#!/bin/bash
echo "====== pull latest upstream/master ========"
git pull upstream master
git rev-parse upstream/master > commit
echo "====== install static deps ========="
cd static && npm install -q && cd ..
cd static/public && npm install -q && cd ../..
echo "====== build static files ========"
cd static && rm -rf dist/ && cd ..
cd static && gulp build && cd ..
echo "====== build binary ========"
godep go build
echo "====== create package ========"
version=$(./banshee -v)
os=$(uname | awk '{print tolower($0)}')
arch=$(go env GOARCH)
printf "====== banshee version: %s\n" ${version}
printf "====== build env: %s %s" ${os} ${arch}
dir=$(printf "banshee%s.%s-%s" ${version} ${os} ${arch})
mkdir -p ${dir}
mkdir -p ${dir}/static
mv commit ${dir}/
cp ./banshee ${dir}/
cp -r ./static/dist ${dir}/static || true
cp ./LICENSE ${dir}/
cp ./README.md ${dir}/
pkg=$(printf "%s.tar.gz" ${dir})
tar cvzf ${pkg} ${dir}
rm -rf ${dir}
du -h ${pkg}