Skip to content

Commit

Permalink
Add script to make releases
Browse files Browse the repository at this point in the history
  • Loading branch information
aebruno committed Apr 17, 2018
1 parent 8868648 commit 5734b11
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===============================================================================
ChangeLog
===============================================================================

`v0.0.1`_ (2018-04-17)
---------------------------

* Initial release

.. _v0.0.1: https://github.com/ubccr/terf/releases/tag/v0.0.1
6 changes: 5 additions & 1 deletion cmd/terf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ import (
"github.com/urfave/cli"
)

var (
TerfVersion = "dev"
)

func main() {
app := cli.NewApp()
app.Name = "terf"
app.Authors = []cli.Author{cli.Author{Name: "Andrew E. Bruno", Email: "aebruno2@buffalo.edu"}}
app.Usage = "terf"
app.Version = "0.0.1"
app.Version = TerfVersion
app.Flags = []cli.Flag{
&cli.BoolFlag{Name: "debug,d", Usage: "Print verbose messages"},
}
Expand Down
27 changes: 27 additions & 0 deletions scripts/make-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

TERF_DIR='./.terf-release'
VERSION=`git describe --long --tags --dirty --always | sed -e 's/^v//'`
for os in linux darwin windows
do
for arch in amd64 386
do
NAME=terf-${VERSION}-${os}-${arch}
REL_DIR=${TERF_DIR}/${NAME}
cd ./cmd/terf && GOOS=$os GOARCH=$arch go build -ldflags "-X main.TerfVersion=$VERSION" .
cd ../../
rm -Rf ${TERF_DIR}
mkdir -p ${REL_DIR}
cp ./cmd/terf/terf* ${REL_DIR}/
cp ./README.rst ${REL_DIR}/
cp ./AUTHORS.rst ${REL_DIR}/
cp ./ChangeLog.rst ${REL_DIR}/
cp ./LICENSE ${REL_DIR}/

cd ${TERF_DIR} && zip -r ${NAME}.zip ${NAME}
mv ${NAME}.zip ../
cd ../
rm -Rf ${TERF_DIR}
rm ./cmd/terf/terf*
done
done

0 comments on commit 5734b11

Please sign in to comment.