Merge pull request #113 from liamg/prepare-build-for-homebrew

homebrew preparation
This commit is contained in:
Liam Galvin 2018-12-06 12:57:14 +00:00 committed by GitHub
commit 5b79cdbca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 4 deletions

View File

@ -102,4 +102,5 @@ workflows:
tags: tags:
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:
@ -34,4 +33,4 @@ build-darwin:
.PHONY: package-debian .PHONY: package-debian
package-debian: build-linux package-debian: build-linux
./scripts/package-debian.sh "${CIRCLE_TAG}" bin/linux/${BINARY}-linux-amd64 ./scripts/package-debian.sh "${CIRCLE_TAG}" bin/linux/${BINARY}-linux-amd64

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"
)