forked from consensus-ai/sentient-miner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·47 lines (36 loc) · 986 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# error output terminates this script
set -e
if [[ -z $1 || -z $2 ]]; then
echo "Usage: $0 PRIVATE_KEY PUBLIC_KEY VERSION"
exit 1
fi
privkeyFile=$1
pubkeyFile=$2
os=$3
arch=$4
version=$5
# ensure we have a clean state, then build binary
make clean
make dependencies
GOOS=$os GOARCH=$arch make release
# create release
compiledBinary="sentient-miner"
binarySuffix="${version}-${os}-${arch}"
binaryName="${compiledBinary}-${binarySuffix}"
zipFile="${binaryName}.zip"
mkdir release
(
cd release
cp $GOPATH/bin/${os}_${arch}/${compiledBinary}* $binaryName 2>/dev/null || :
cp $GOPATH/bin/${compiledBinary}* $binaryName 2>/dev/null || :
if [ "$os" == "windows" ]; then
mv $binaryName ${binaryName}.exe
binaryName=${binaryName}.exe
fi
chmod +x $binaryName
zip -r $zipFile $binaryName
openssl dgst -sha256 -sign $privkeyFile -out $zipFile.sig $zipFile
openssl dgst -sha256 -verify $pubkeyFile -signature $zipFile.sig $zipFile
)
echo "Done"