release script

This commit is contained in:
Liam Galvin 2018-11-24 18:38:40 +00:00
parent a9c31e7a8e
commit 550c841411
3 changed files with 42 additions and 28 deletions

View File

@ -3,7 +3,7 @@
# Check https://circleci.com/docs/2.0/language-go/ for more details # Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2 version: 2
jobs: jobs:
build: test:
docker: docker:
# specify the version # specify the version
- image: liamg/golang-opengl - image: liamg/golang-opengl
@ -11,7 +11,7 @@ jobs:
steps: steps:
- checkout - checkout
- run: make test - run: make test
release: build-linux:
docker: docker:
# specify the version # specify the version
- image: liamg/golang-opengl - image: liamg/golang-opengl
@ -20,17 +20,40 @@ jobs:
- build - build
steps: steps:
- checkout - checkout
- run: make release - run: make build-linux
- run: tree release - run: tree bin
filters: build-darwin:
tags: docker:
only: /.*/ # specify the version
- image: karalabe/xgo-latest:latest
working_directory: /go/src/github.com/liamg/aminal
steps:
- checkout
- run: make build-darwin
- run: tree bin
release:
docker:
# specify the version
- image: karalabe/xgo-latest:latest
working_directory: /go/src/github.com/liamg/aminal
steps:
- checkout
- run: echo nothing to do
workflows: workflows:
version: 2 version: 2
build: build:
jobs: jobs:
- build - test
- build-darwin
requires:
- test
- build-linux
requires:
- test
- release: - release:
requires:
- build-linux
- build-darwin
filters: filters:
tags: tags:
only: /.*/ only: /.*/

View File

@ -30,7 +30,14 @@ update-fonts: install-tools
curl -L https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Bold/complete/Hack%20Bold%20Nerd%20Font%20Complete.ttf -o "${FONTPATH}/Hack Bold Nerd Font Complete.ttf" curl -L https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Bold/complete/Hack%20Bold%20Nerd%20Font%20Complete.ttf -o "${FONTPATH}/Hack Bold Nerd Font Complete.ttf"
packr -v packr -v
.PHONY: release .PHONY: build-linux
release: test install-tools build-linux: test install-tools
./scripts/release.sh mkdir -p bin
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o bin/aminal-linux-amd64
.PHONY: build-darwin
build-darwin: test install-tools
mkdir -p bin
xgo --targets=darwin/amd64 --dest=bin -out ${BINARY}-darwin-amd64 .

View File

@ -1,22 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -e
BINARY=aminal
if [[ "${CIRCLE_TAG}" == "" ]]; then
exit 0 # no tag, nothing to release
fi
mkdir -p release/bin/darwin/amd64/
mkdir -p release/bin/linux/amd64/
mkdir -p release/bin/linux/i386/
# build for osx using xgo - this cannot be used for linux builds due to missing deps in the xgo containers
# xgo --targets=darwin/amd64 --dest=release/bin/darwin/amd64 -out ${BINARY} .
GOOS=linux GOARCH=386 CGO_ENABLED=1 go build -o release/bin/linux/i386/aminal
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o release/bin/linux/amd64/aminal
exit 0
git tag "${VERSION}" git tag "${VERSION}"