homebrew preparation

This commit is contained in:
Liam Galvin 2018-12-06 12:54:17 +00:00
parent f89e60e130
commit 8d8e9166ab
3 changed files with 32 additions and 4 deletions

View File

@ -103,3 +103,4 @@ workflows:
only: /^v.*/ only: /^v.*/
branches: branches:
ignore: /.*/ ignore: /.*/

View File

@ -4,8 +4,7 @@ FONTPATH := ./gui/packed-fonts
.PHONY: build .PHONY: build
build: test install-tools build: test install-tools
packr -v ./build.sh `git describe --tags`
go build -ldflags "-X github.com/liamg/aminal/version.Version=`git describe --tags`"
.PHONY: test .PHONY: test
test: test:

28
build.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
set -eux
version="$1"
if [[ "$version" == "" ]]; then
version=`git describe --tags`
fi
if [[ "$version" == "" ]]; then
echo "Error: Cannot determine version"
exit 1
fi
export GOPATH="/tmp/.gobuild"
SRCDIR="${GOPATH}/src/github.com/liamg/aminal"
[ -d ${GOPATH} ] && rm -rf ${GOPATH}
mkdir -p ${GOPATH}/{src,pkg,bin}
mkdir -p ${SRCDIR}
cp -r . ${SRCDIR}
(
echo ${GOPATH}
cd ${SRCDIR}
go install -ldflags "-X github.com/liamg/aminal/version.Version=$version"
)