mirror of https://github.com/liamg/aminal.git
releasing
This commit is contained in:
parent
22fc919085
commit
dfa828468b
|
@ -13,7 +13,6 @@ jobs:
|
||||||
- run: make test
|
- run: make test
|
||||||
build-linux:
|
build-linux:
|
||||||
docker:
|
docker:
|
||||||
# specify the version
|
|
||||||
- image: liamg/golang-opengl
|
- image: liamg/golang-opengl
|
||||||
working_directory: /go/src/github.com/liamg/aminal
|
working_directory: /go/src/github.com/liamg/aminal
|
||||||
requires:
|
requires:
|
||||||
|
@ -22,25 +21,18 @@ jobs:
|
||||||
- checkout
|
- checkout
|
||||||
- run: make build-linux
|
- run: make build-linux
|
||||||
- persist_to_workspace:
|
- 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: .
|
root: .
|
||||||
# Must be relative path from root
|
|
||||||
paths:
|
paths:
|
||||||
- bin/linux
|
- bin/linux
|
||||||
build-darwin:
|
build-darwin:
|
||||||
docker:
|
docker:
|
||||||
# specify the version
|
|
||||||
- image: karalabe/xgo-latest:latest
|
- image: karalabe/xgo-latest:latest
|
||||||
working_directory: /go/src/github.com/liamg/aminal
|
working_directory: /go/src/github.com/liamg/aminal
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: make build-darwin
|
- run: make build-darwin
|
||||||
- persist_to_workspace:
|
- 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: .
|
root: .
|
||||||
# Must be relative path from root
|
|
||||||
paths:
|
paths:
|
||||||
- bin/darwin
|
- bin/darwin
|
||||||
release:
|
release:
|
||||||
|
@ -48,7 +40,6 @@ jobs:
|
||||||
- image: circleci/golang:latest
|
- image: circleci/golang:latest
|
||||||
steps:
|
steps:
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
# Must be absolute path or relative path from working_directory
|
|
||||||
at: ./workspace
|
at: ./workspace
|
||||||
- run:
|
- run:
|
||||||
name: "Publish Release on GitHub"
|
name: "Publish Release on GitHub"
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -31,11 +31,9 @@ update-fonts: install-tools
|
||||||
.PHONY: build-linux
|
.PHONY: build-linux
|
||||||
build-linux:
|
build-linux:
|
||||||
mkdir -p bin/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
|
.PHONY: build-darwin
|
||||||
build-darwin:
|
build-darwin:
|
||||||
mkdir -p bin/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 .
|
||||||
|
|
||||||
|
|
||||||
|
|
15
config.go
15
config.go
|
@ -9,7 +9,13 @@ import (
|
||||||
"github.com/liamg/aminal/config"
|
"github.com/liamg/aminal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var Version string
|
||||||
|
|
||||||
func getConfig() *config.Config {
|
func getConfig() *config.Config {
|
||||||
|
|
||||||
|
showVersion := false
|
||||||
|
flag.BoolVar(&showVersion, "version", showVersion, "Output version information")
|
||||||
|
|
||||||
ignore := false
|
ignore := false
|
||||||
flag.BoolVar(&ignore, "ignore-config", ignore, "Ignore user config files and use defauls")
|
flag.BoolVar(&ignore, "ignore-config", ignore, "Ignore user config files and use defauls")
|
||||||
if ignore {
|
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.BoolVar(&conf.Slomo, "slomo", conf.Slomo, "Render in slow motion (useful for debugging)")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if showVersion {
|
||||||
|
if Version == "" {
|
||||||
|
Version = "development"
|
||||||
|
}
|
||||||
|
fmt.Printf("Aminal %s\n", Version)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
return conf
|
return conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue