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

Refactoring #26

Merged
merged 5 commits into from
Feb 12, 2020
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
8 changes: 0 additions & 8 deletions .bonsai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ builds:
- "entity.system.os == 'darwin'"
- "entity.system.arch == 'amd64'"

- platform: "OSX"
arch: "386"
asset_filename: "#{repo}_#{version}_darwin_386.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'darwin'"
- "entity.system.arch == '386'"

- platform: "Windows"
arch: "amd64"
asset_filename: "#{repo}_#{version}_windows_amd64.tar.gz"
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: goreleaser

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Go Test

on: [push]

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Test
run: go test -v ./...
49 changes: 21 additions & 28 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
builds:
# List of builds
- # First Build
env:
- env:
- CGO_ENABLED=0
main: main.go
ldflags: '-s -w -X github.com/sensu-community/sensu-plugin-sdk/version.build={{.Version}} -X github.com/sensu-community/sensu-plugin-sdk/version.commit={{.Commit}} -X github.com/sensu-community/sensu-plugin-sdk/version.date={{.Date}}'
# 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
Expand All @@ -22,28 +18,25 @@ builds:
- 5
- 6
- 7
ignore:
# TODO: add freebsd/arm support to gopsutil
- goos: freebsd
goarch: arm
targets:
- darwin_amd64
- linux_386
- linux_amd64
- linux_arm_5
- linux_arm_6
- linux_arm_7
- linux_arm64
- windows_386
- windows_amd64

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

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}}"
archives:
- id: tar
format: tar.gz
files:
- LICENSE
- README.md
- CHANGELOG.md
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

Loading