forked from OpenBazaar/openbazaar-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·37 lines (29 loc) · 1.2 KB
/
deploy.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
#!/bin/bash
if [ ! -z "$TRAVIS_TAG" ] &&
[ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "This will deploy!"
# Cross-compile for all platforms
export CGO_ENABLED=1
docker pull karalabe/xgo-latest
go get github.com/karalabe/xgo
mkdir dist/ && cd dist/
xgo --targets=windows/386,windows/amd64,darwin/amd64,linux/386,linux/amd64,linux/arm ../
chmod +x *
# Copy libwinpthread-1.dll (user must rename the dll for their system to libwinpthread-1.dll)
cp ../.travis/win32/libwinpthread-1.dll libwinpthread-1.win32.dll
cp ../.travis/win64/libwinpthread-1.dll libwinpthread-1.win64.dll
# Calculate SHA512 hashes
sha512sum * > sha512_checksums.txt
# Load signing key
cp ../.travis/sign.key.gpg /tmp
gpg --yes --batch --passphrase=$GPG_PASS /tmp/sign.key.gpg
gpg --allow-secret-key-import --import /tmp/sign.key.gpg
rm /tmp/sign.key.gpg
# Sign hash file
gpg --clearsign --digest-algo SHA512 --armor --output sha512_checksums.asc --passphrase=$GPG_PASS --default-key $GPG_KEYID sha512_checksums.txt
rm sha512_checksums.txt
# Upload to GitHub Release page
ghr --username OpenBazaar -t $GITHUB_TOKEN --replace --prerelease --debug $TRAVIS_TAG .
else
echo "This will not deploy!"
fi