This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
package.sh
executable file
·63 lines (54 loc) · 2.08 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/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 "nheqminer-macos rev version : $git_rev_string"
echo "nheqminer-macos tag version : $git_tag_string"
echo "creating 'nheqminer-macos-$release_version' release"
# prepare environment
source environment;
export BSPJOB=16;
export BSPINSTALL=${BSPROOT}/nheqminer-macos-$release_version;
# build tools
mkdir -p ${BSPINSTALL}
make
cp -a miner/* ${BSPINSTALL}
echo "nheqminer" > ${BSPINSTALL}/version.txt
echo "=========" >> ${BSPINSTALL}/version.txt
echo $git_rev_string >> ${BSPINSTALL}/version.txt
echo $git_tag_string >> ${BSPINSTALL}/version.txt
echo "platform" >> ${BSPINSTALL}/version.txt
echo "========" >> ${BSPINSTALL}/version.txt
sw_vers >> ${BSPINSTALL}/version.txt
echo "compiler" >> ${BSPINSTALL}/version.txt
echo "========" >> ${BSPINSTALL}/version.txt
gcc -v 2>> ${BSPINSTALL}/version.txt
echo "cuda" >> ${BSPINSTALL}/version.txt
echo "====" >> ${BSPINSTALL}/version.txt
/usr/local/cuda/bin/nvcc --version >> ${BSPINSTALL}/version.txt
echo "nheqminer for macOS ($release_version) is installed to ${BSPINSTALL}"
# create tarball and checksum
echo "creating tarball 'nheqminer-macos-$release_version.tar.bz2' and checksum"
tar -cjvf nheqminer-macos-$release_version.tar.bz2 nheqminer-macos-$release_version
shasum -a 256 nheqminer-macos-$release_version.tar.bz2 > nheqminer-macos-$release_version.tar.bz2.hash
shasum -a 256 -c nheqminer-macos-$release_version.tar.bz2.hash