Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
add travis-ci and auto release on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
wakeful committed Feb 4, 2018
1 parent 040816a commit 8a067fc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: go
go:
- 1.9
script: go vet
before_deploy:
- "./build.sh"
deploy:
provider: releases
api_key:
secure: kBVpKtEmH2EtE37KtrUZ4NDmZQCqDgNiBsD4vEyY5kyY65TQUhCpE2kKyeKTzGTrZNVqGT2V2dR1r6tZ2DT4KL9ZuvaMt3Lsm/YDeuhczVUj3GNgqEKNdr7HAyjwhPVH9NQkD3W3lE3QnSbsan0q/FSi7tTez3s+KwY1LpQtKEU+XSSewFVv2IKZcWBKRtbtsOnhpd1aestB3bhwYUBQTm7lX/yWM6gkLgG1a1MZkCbdnh/0aTveFep1qlN2Ck2oqSNoLwryNJQu0J97lu2cX44hKMEhP6M95SVkVIH7yzz8PpIpnVvKUqaV4J3l4LK5JhU68gR+V+F5+y80uRTU1NIxFWs5kFdCnygL2UUNvQ3NlyudnMeQsHMIQ5hk3F4bZf5XHMu7IxuI80uIqn6PCTJM3q9kSBLK7lKSQS5HuQpAQcB10vNXF7ghzHohJChMmRoEJuIxJr5Pa7e5DwdvkrEVYT9mKDnPsqH0cY1gIS1T8lMB84xoDK/ivAhcBYOrFA3ldugMItXEcIEGJha+vk/1d1sG3HwiHjuo/FPUV10BmUwD5JrNsPIJm3aCxeU4ZJpXno2b8fkctz5mVAPw4b2VCFLRUZe5xCE41gDRjbPXqPVwVRhoqUgqyw5DhoZ2k2pbuio48fKG2Fvf0FyLpyrESLhao/EOpqpXWZgPE6A=
skip_cleanup: true
file:
- release/bamboo_exporter-linux-amd64
- release/bamboo_exporter-linux-amd64.sha256
on:
repo: wakeful/bamboo_exporter
branch: master
tags: true
22 changes: 22 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -e

VERSION=$(git describe --tags --dirty)
GO_BUILD_CMD="go build -a -installsuffix cgo"
GO_BUILD_LDFLAGS="-s -w -X main.version=$VERSION"

BUILD_PLATFORMS="linux"
BUILD_ARCHS="amd64"

mkdir -p release

for OS in ${BUILD_PLATFORMS[@]}; do
for ARCH in ${BUILD_ARCHS[@]}; do
NAME="bamboo_exporter-$OS-$ARCH"
echo "Building for $OS/$ARCH"
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 $GO_BUILD_CMD -ldflags "$GO_BUILD_LDFLAGS"\
-o "release/$NAME" bamboo_exporter.go
shasum -a 256 "release/$NAME" > "release/$NAME".sha256
done
done

0 comments on commit 8a067fc

Please sign in to comment.