Skip to content

Commit

Permalink
add release script (#163)
Browse files Browse the repository at this point in the history
* add release script

* use more portable openssl

* add buildid= to ldflags
  • Loading branch information
dajohi authored Nov 19, 2019
1 parent b2dadda commit 648efbb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmd/dcrinstall/dcrinstall
*.sw?
.vscode
release/
vendor/
*~
30 changes: 30 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Copyright (c) 2019 The Decred developers
# Use of this source code is governed by the ISC
# license.

set -ex

TAG=$1
REL=(-ldflags "-buildid= -X main.appBuild=release")

PWD=$(pwd)
PACKAGE=dcrinstall
MAINDIR=$PWD/release/$PACKAGE-$TAG
mkdir -p $MAINDIR

SYS="darwin-amd64 freebsd-amd64 linux-386 linux-amd64 linux-arm64 openbsd-amd64 windows-386 windows-amd64"

for i in $SYS; do
OS=$(echo $i | cut -f1 -d-)
ARCH=$(echo $i | cut -f2 -d-)
OUT="$MAINDIR/dcrinstall-$i-$TAG"
if [[ $OS = "windows" ]]; then
OUT="$OUT.exe"
fi
echo "Building:" $OS $ARCH
env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH go build -trimpath -tags 'safe,netgo' -o $OUT "${REL[@]}" ./cmd/dcrinstall
done

(cd $MAINDIR && openssl sha256 -r * > dcrinstall-$TAG-manifest.txt)

0 comments on commit 648efbb

Please sign in to comment.