releasing

This commit is contained in:
Liam Galvin 2018-11-24 19:43:22 +00:00
parent 22fc919085
commit dfa828468b
3 changed files with 17 additions and 13 deletions

View File

@ -13,7 +13,6 @@ jobs:
- run: make test
build-linux:
docker:
# specify the version
- image: liamg/golang-opengl
working_directory: /go/src/github.com/liamg/aminal
requires:
@ -22,25 +21,18 @@ jobs:
- checkout
- run: make build-linux
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory. This is a directory on the container which is
# taken to be the root directory of the workspace.
root: .
# Must be relative path from root
paths:
- bin/linux
build-darwin:
docker:
# specify the version
- image: karalabe/xgo-latest:latest
working_directory: /go/src/github.com/liamg/aminal
steps:
- checkout
- run: make build-darwin
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory. This is a directory on the container which is
# taken to be the root directory of the workspace.
root: .
# Must be relative path from root
paths:
- bin/darwin
release:
@ -48,7 +40,6 @@ jobs:
- image: circleci/golang:latest
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ./workspace
- run:
name: "Publish Release on GitHub"

View File

@ -31,11 +31,9 @@ update-fonts: install-tools
.PHONY: build-linux
build-linux:
mkdir -p bin/linux
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o bin/${BINARY}-linux-amd64
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o bin/${BINARY}-linux-amd64 -ldflags "-X main.Version=`${CIRCLE_TAG}`
.PHONY: build-darwin
build-darwin:
mkdir -p bin/darwin
xgo --targets=darwin/amd64 --dest=bin/darwin -out ${BINARY}-darwin-amd64 .
xgo -ldflags "-X main.Version=`${CIRCLE_TAG}` --targets=darwin/amd64 --dest=bin/darwin -out ${BINARY}-darwin-amd64 .

View File

@ -9,7 +9,13 @@ import (
"github.com/liamg/aminal/config"
)
var Version string
func getConfig() *config.Config {
showVersion := false
flag.BoolVar(&showVersion, "version", showVersion, "Output version information")
ignore := false
flag.BoolVar(&ignore, "ignore-config", ignore, "Ignore user config files and use defauls")
if ignore {
@ -23,6 +29,15 @@ func getConfig() *config.Config {
flag.BoolVar(&conf.Slomo, "slomo", conf.Slomo, "Render in slow motion (useful for debugging)")
flag.Parse()
if showVersion {
if Version == "" {
Version = "development"
}
fmt.Printf("Aminal %s\n", Version)
os.Exit(0)
}
return conf
}