This repository has been archived by the owner on Dec 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from babbel/travis-build
Added travis.yml
- Loading branch information
Showing
1 changed file
with
35 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,35 @@ | ||
language: go | ||
|
||
go: | ||
- "1.11.1" | ||
|
||
env: | ||
global: | ||
- LINUX_BINARY_NAME: terraform-provider-codeclimate | ||
- DARWIN_BINARY_NAME: darwin_amd64/terraform-provider-codeclimate | ||
|
||
script: | ||
- go vet . | ||
- go test ./... | ||
|
||
# Build and zip the binaries. | ||
before_deploy: | ||
- GIT_TAG=$(git describe --tags) | ||
- GOOS=linux go build -o ${LINUX_BINARY_NAME}_${GIT_TAG} | ||
- zip -j ${LINUX_BINARY_NAME}_${GIT_TAG}_linux_amd64.zip ${LINUX_BINARY_NAME}_${GIT_TAG} | ||
- GOOS=darwin go build -o ${DARWIN_BINARY_NAME}_${GIT_TAG} | ||
- zip -j ${DARWIN_BINARY_NAME}_${GIT_TAG}_darwin_amd64.zip ${DARWIN_BINARY_NAME}_${GIT_TAG} | ||
|
||
# Deploy only when a tag is created and pushed to the master branch. | ||
deploy: | ||
provider: releases | ||
api_key: ${GITHUB_API_KEY} | ||
file: | ||
- ${LINUX_BINARY_NAME}_${GIT_TAG}_linux_amd64.zip | ||
- ${DARWIN_BINARY_NAME}_${GIT_TAG}_darwin_amd64.zip | ||
skip_cleanup: true | ||
file_glob: "true" | ||
on: | ||
branch: "master" | ||
tags: true | ||
condition: ${GIT_TAG} =~ ^v[0-9]+\.[0-9]+\.[0-9]$ |