forked from timxor/zcash-apple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·49 lines (41 loc) · 1.52 KB
/
package.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
#!/bin/sh
# get version info
git_rev_output=$(git rev-parse --verify HEAD)
git_tag_output=$(git describe --all --exact-match $git_rev_output)
git_status_output=$(git diff)
# check if associated tag exist for that commit
if [[ $git_tag_output == *"tags"* ]]; then
git_tag_string=${git_tag_output##*/}
else
git_tag_string="unknown"
fi
# check for any code modifications
if [ -n "$git_status_output" ]; then
git_rev_string=$git_rev_output-dirty
git_tag_string="unknown"
else
git_rev_string=$git_rev_output
fi
# pick version string (tag name, if exists or commit version)
if [[ $git_tag_string == "unknown" ]]; then
release_version=$git_rev_string
else
release_version=$git_tag_string
fi
echo "zcash-for-macos commit version : $git_rev_string"
echo "zcash-for-macos tag version : $git_tag_string"
echo "creating 'zcash-macos-$release_version' release"
# prepare environment
source environment;
export BSPJOB=16;
export BSPINSTALL=${BSPROOT}/zcash-macos-$release_version;
# build tools
make
echo $git_rev_string > ${BSPINSTALL}/usr/local/bin/version.txt
echo $git_tag_string >> ${BSPINSTALL}/usr/local/bin/version.txt
echo "Zcash for macOS ($release_version) is installed to ${BSPINSTALL}"
# create tarball and checksum
echo "creating Zcash tarball 'zcash-macos-$release_version.tar.bz2' and checksum"
tar -cjvf zcash-macos-$release_version.tar.bz2 zcash-macos-$release_version
shasum -a 256 zcash-macos-$release_version.tar.bz2 > zcash-macos-$release_version.tar.bz2.hash
shasum -a 256 -c zcash-macos-$release_version.tar.bz2.hash