-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4337659
commit 000303e
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/golang:1.11 | ||
steps: | ||
- checkout | ||
- run: go test -v -failfast ./... | ||
release: | ||
docker: | ||
- image: circleci/golang:1.11 | ||
steps: | ||
- checkout | ||
- run: go get github.com/tcnksm/ghr | ||
- run: go get github.com/mitchellh/gox | ||
- run: mkdir dist | ||
- run: echo "export BUILD_TAG=$(git describe --tags)" >> $BASH_ENV | ||
- run: echo "export BUILD_SHA=$(git rev-parse --short HEAD)" >> $BASH_ENV | ||
- run: echo "export BUILD_DATE=$(date -u '+%Y/%m/%d:%H:%M:%S')" >> $BASH_ENV | ||
- run: gox -verbose -osarch="darwin/amd64 linux/amd64 linux/arm linux/arm64 windows/amd64 netbsd/amd64 openbsd/amd64 freebsd/amd64" -ldflags "-X main.tag=$BUILD_TAG -X main.sha=$BUILD_SHA -X main.buildDate=$BUILD_DATE" -output "dist/aws-ips_{{.OS}}_{{.Arch}}" ./... | ||
- run: | ||
name: "Publish Release on GitHub" | ||
command: | | ||
VERSION=$(git describe --tags) | ||
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${VERSION} ./dist/ | ||
workflows: | ||
version: 2 | ||
build-release: | ||
jobs: | ||
- build: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- release: | ||
requires: | ||
- build | ||
filters: | ||
tags: | ||
only: /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)/ | ||
branches: | ||
ignore: /.*/ |