Skip to content

Commit

Permalink
homebrew preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
liamg committed Dec 6, 2018
1 parent f89e60e commit 8d8e916
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Expand Up @@ -102,4 +102,5 @@ workflows:
tags:
only: /^v.*/
branches:
ignore: /.*/
ignore: /.*/

5 changes: 2 additions & 3 deletions Makefile
Expand Up @@ -4,8 +4,7 @@ FONTPATH := ./gui/packed-fonts

.PHONY: build
build: test install-tools
packr -v
go build -ldflags "-X github.com/liamg/aminal/version.Version=`git describe --tags`"
./build.sh `git describe --tags`

.PHONY: test
test:
Expand Down Expand Up @@ -34,4 +33,4 @@ build-darwin:

.PHONY: package-debian
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 changes: 28 additions & 0 deletions build.sh
@@ -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"
)

0 comments on commit 8d8e916

Please sign in to comment.