Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4 from babbel/travis-build
Browse files Browse the repository at this point in the history
Added travis.yml
  • Loading branch information
Kirill Zonov committed May 8, 2019
2 parents 068e02f + 0db6567 commit ca1a4d5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .travis.yml
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]$

0 comments on commit ca1a4d5

Please sign in to comment.