aminal/.circleci/config.yml

83 lines
2.0 KiB
YAML

# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
test:
docker:
# specify the version
- image: liamg/golang-opengl
working_directory: /go/src/github.com/liamg/aminal
steps:
- checkout
- run: make test
build-linux:
docker:
- image: liamg/golang-opengl
working_directory: /go/src/github.com/liamg/aminal
requires:
- build
steps:
- checkout
- run: make build-linux
- persist_to_workspace:
root: bin
paths:
- linux
build-darwin:
docker:
- image: karalabe/xgo-latest:latest
working_directory: /go/src/github.com/liamg/aminal
steps:
- checkout
- run: make build-darwin
- persist_to_workspace:
root: bin
paths:
- darwin
release:
docker:
- image: circleci/golang:latest
steps:
- run: mkdir -p artifacts
- attach_workspace:
at: artifacts
- run:
name: "Publish Release on GitHub"
command: |
go get github.com/tcnksm/ghr
mkdir -p release
ls -la artifacts/linux
ls -la artifacts/darwin
cp artifacts/linux/* release/
cp artifacts/darwin/* release/
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} release/
workflows:
version: 2
build:
jobs:
- test:
filters:
tags:
only: /.*/
- build-darwin:
requires:
- test
filters:
tags:
only: /.*/
- build-linux:
requires:
- test
filters:
tags:
only: /.*/
- release:
requires:
- build-linux
- build-darwin
filters:
tags:
only: /.*/
branches:
ignore: /.*/