Skip to content

Commit

Permalink
Add release building
Browse files Browse the repository at this point in the history
  • Loading branch information
aebruno committed Dec 5, 2018
1 parent 8438215 commit c5e220e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# myoxi Changelog

## [0.0.1] - 2018-12-04

- Initial release

[Unreleased]: https://github.com/aebruno/myoxi/compare/v0.0.1...HEAD
[0.0.1]: https://github.com/aebruno/myoxi/releases/tag/v0.0.1
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e h1:9MlwzLdW7QSDrhDjFlsEYmxpFyIoXmYRon3dt0io31k=
Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ import (
"github.com/urfave/cli"
)

var (
MyoxiVersion = "dev"
)

func connectDevice(port string) (device.Device, error) {
log.Infof("Using device port: %s", port)

Expand Down Expand Up @@ -108,7 +112,7 @@ func main() {
app.Name = "myoxi"
app.Authors = []cli.Author{cli.Author{Name: "Andrew E. Bruno", Email: "[email protected]"}}
app.Usage = "myoxi"
app.Version = "0.0.1"
app.Version = MyoxiVersion
app.Flags = []cli.Flag{
&cli.BoolFlag{Name: "debug,d", Usage: "Print debug messages"},
&cli.StringFlag{Name: "port, p", Usage: "Path to device port", Value: "/dev/ttyUSB0"},
Expand Down
24 changes: 24 additions & 0 deletions scripts/make-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

MYOXI_DIR='./.myoxi-release'
VERSION=`git describe --long --tags --dirty --always | sed -e 's/^v//'`
for os in linux windows
do
for arch in amd64 386
do
rm -Rf ${MYOXI_DIR}
GOOS=$os GOARCH=$arch go build -ldflags "-X main.MyoxiVersion=$VERSION" .

NAME=myoxi-${VERSION}-${os}-${arch}
REL_DIR=${MYOXI_DIR}/${NAME}
mkdir -p ${REL_DIR}
cp ./myoxi* ${REL_DIR}/
cp ./README.md ${REL_DIR}/
cp ./CHANGELOG.md ${REL_DIR}/
cp ./LICENSE ${REL_DIR}/
cd ${MYOXI_DIR} && zip -r ../${NAME}.zip ${NAME}
cd ..
rm -Rf ${MYOXI_DIR}
rm -f myoxi myoxi.exe
done
done

0 comments on commit c5e220e

Please sign in to comment.