Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate asset builds with goreleaser and travis ci #12

Merged
merged 2 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ sensu-prometheus-collector

# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/

# dep
vendor/
49 changes: 49 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
builds:
# List of builds
- # First Build
env:
- CGO_ENABLED=0
main: main.go
# Set the binary output location to bin/ so archive will comply with Sensu Go Asset structure
binary: bin/{{ .ProjectName }}
goos:
- darwin
- freebsd
- linux
- netbsd
- solaris
- windows
goarch:
- amd64
- 386
- arm
- arm64
goarm:
- 5
- 6
- 7
ignore:
# TODO: add freebsd/arm support to gopsutil
- goos: freebsd
goarch: arm

checksum:
# You can change the name of the checksums file.
# Default is `{{ .ProjectName }}_{{ .Version }}_checksums.txt`.
name_template: "{{ .ProjectName }}_{{ .Version }}_sha256-checksums.txt"

archive:
format: tar.gz
files:
- LICENSE
- README.md
- CHANGELOG.md

# You can change the name of the GitHub release.
# This is parsed with the Go template engine and the following variables
# are available:
# - ProjectName
# - Tag
# - Version (Git tag without `v` prefix)
# Default is ``
#name_template: "{{.ProjectName}}-v{{.Version}}"
36 changes: 36 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
language: go
go:
- 1.10.x
install:
- go get gopkg.in/alecthomas/gometalinter.v1
- go get github.com/gordonklaus/ineffassign
- go get github.com/jgautheron/goconst/cmd/goconst
- go get github.com/kisielk/errcheck
- go get github.com/golang/dep/cmd/dep
- dep ensure
script:
- gometalinter.v1 --vendor --disable-all --enable=vet --enable=ineffassign
--enable=goconst --tests ./...

before_script:
- echo "REPO $TRAVIS_REPO_SLUG TAG ${TRAVIS_TAG}"

before_deploy:
- go get github.com/goreleaser/goreleaser

deploy:
- #goreleaser
provider: script
script: goreleaser
skip_cleanup: true
on:
tags: true

after_deploy:
- git clone https://github.com/sensu/sensu-go-bonsai-asset.git bonsai
- bonsai/generate-sha512sum.sh
- bonsai/github-release-upload.sh github_api_token=$GITHUB_TOKEN repo_slug="$TRAVIS_REPO_SLUG" tag="${TRAVIS_TAG}" filename="dist/$(cat dist/sha512_file)"

env:
global:
- secure: p/MuR4jBpozPFyNiVls3oNitrzGQHHuQYi4zo/i47J0UNA57qZvu6mjxQfxMrfm9zVhzKya35S6hpY0zh4Q21ZXqYP0U8ITCWnd7txRSzne1gC2MP1BOw70nXtFnZwhivNbZA+1AY/2ikZ1ayC/IFfmJr+YEQRgHS7ZrZO+xfpf/PKLi7bxEozMgAeNvK2W7R+cc5aOpRzIce8ADykbAqdRLBug/EohSFB0tZlZ4+P1hudjk20WmlvkOnWssMmQd910pqcXwBUGi2o77S8u5pHlW+g3ojUYgxFyOWJx29juf2iv4/k+DGAMKVSQuDpYD9kSdlNqftGBAxnI9+xNteTwAG2Z8gCWaSvMPFHHvkru0/lYy7njDY5fqC8mhUUqbJH0TlCBU8mY4HwwhkTxhCTjwjLueRo99RgnatlcSTvcX/FNvFJ24s2tKXHRX408NE2R3acXc3SDYHUN3HyJc71lcKniptj+Ut5S+i85L961rgsCI9KArJ8ugpc3dNpA8oZEEok6OWQoKjhrJEkn6hwEP3n/k+Kj5rJy3cM0OyXD3z2d1bZ2b23jG6kp8PtpPlhHTy/GBDvJdC3tft0hBzfZXOcYAoM8byfGicVqEZ1YGz7ZhaJIu5ZN5PV6ZlXyuQ1ouEUwKr9frsvlp4DUfMzs8pazoEnVvotGmQu+fc14=
128 changes: 128 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/kelseyhightower/envconfig"
version = "1.3.0"

[[constraint]]
name = "github.com/prometheus/client_golang"
version = "0.8.0"

[[constraint]]
branch = "master"
name = "github.com/prometheus/common"

[[constraint]]
name = "github.com/stretchr/testify"
version = "1.2.2"

[prune]
go-tests = true
unused-packages = true
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions vendor/github.com/beorn7/perks/LICENSE

This file was deleted.

Loading