Skip to content
Open
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
52 changes: 25 additions & 27 deletions .bonsai.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,59 @@
---
description: "#{repo}"
builds:
description: "#{repo}"
builds:
- platform: "linux"
arch: "amd64"
asset_filename: "#{repo}_#{version}_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"

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

- platform: "linux"
arch: "arm64"
asset_filename: "#{repo}_#{version}_linux_arm64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'arm64'"
- "entity.system.os == 'linux'"
- "entity.system.arch == 'arm64'"

- platform: "linux"
arch: "armv7"
asset_filename: "#{repo}_#{version}_linux_armv7.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'arm'"
- "entity.system.arm_version == 7"
- "entity.system.os == 'linux'"
- "entity.system.arch == 'armv7'"

- platform: "linux"
arch: "armv6"
asset_filename: "#{repo}_#{version}_linux_armv6.tar.gz"
- platform: "OSX"
arch: "amd64"
asset_filename: "#{repo}_#{version}_darwin_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'arm'"
- "entity.system.arm_version == 6"
- "entity.system.os == 'darwin'"
- "entity.system.arch == 'amd64'"

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

- platform: "Windows"
arch: "amd64"
asset_filename: "#{repo}_#{version}_windows_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'windows'"
- "entity.system.arch == 'amd64'"
- "entity.system.os == 'windows'"
- "entity.system.arch == 'amd64'"

31 changes: 31 additions & 0 deletions .github/workflows/bonsai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Bonsai

##
# Only run this workflow after goreleaser completes
##
permissions:
contents: read
on:
workflow_run:
workflows:
- goreleaser
types:
- completed

jobs:
##
# Note:
# The Bonsai GitHub webhook integration looks for a GitHub webhook payload matching a worflow_job named: `bonsai-recompile` with status: `completed`
# To enable automatic Bonsai recompiles after building a new release in github make sure webhook_jobs events are enabled for
# the Bonsai GitHub webhook installed in GitHub repository by Bonsai as part of the asset repository resgistration process
##
bonsai-recompile:
##
# Only run this workflow_job after goreleaser completes successfully
##
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: bonsai-webhook
continue-on-error: true
run: echo "Trigger recompile on 'completed' workflow_job event matching workflow_job.name 'bonsai-recompile' and workflow.name 'bonsai'"
Comment thread Fixed
12 changes: 7 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Go Lint

on: [push]
on: [push, pull_request]

jobs:
test:
Expand All @@ -10,7 +10,9 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
- name: Checkout code
uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
args: '--timeout=5m --exclude="SA1019" --exclude="SA9003"'
31 changes: 29 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,41 @@ jobs:
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14.x
go-version: 1.23.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Move GoReleaser dist to builds for Bonsai tar file
run: mv dist builds
- name: Create Bonsai tar file for upload
run: tar czvf ${{ github.event.repository.name }}_${{ steps.get_version.outputs.VERSION }}.tgz .bonsai.yml builds/*.tar.gz builds/*_sha512-checksums.txt *.md
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ github.event.repository.name }}_${{ steps.get_version.outputs.VERSION }}.tgz
asset_name: ${{ github.event.repository.name }}_${{ steps.get_version.outputs.VERSION }}.tgz
asset_content_type: application/gzip
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Go Test

on: [push]
on: [push, pull_request]

jobs:
test:
Expand All @@ -10,12 +10,12 @@ jobs:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Test
run: go test -v ./...
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go 1.23
uses: actions/setup-go@v1
with:
go-version: 1.23.x
id: go
- name: Test
run: go test -v ./...
6 changes: 4 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ builds:
# List of builds
- # First Build
env:
- CGO_ENABLED=0
main: .
- CGO_ENABLED=0
- GO111MODULE=on
main: main.go
ldflags: '-s -w -X github.com/sensu/sensu-plugin-sdk/version.version={{.Version}} -X github.com/sensu/sensu-plugin-sdk/version.commit={{.Commit}} -X github.com/sensu/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 }}
Expand All @@ -22,6 +23,7 @@ builds:
- 7
targets:
- darwin_amd64
- darwin_arm64
- linux_386
- linux_amd64
- linux_arm_5
Expand Down
8 changes: 8 additions & 0 deletions .idea/.gitignore

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

9 changes: 9 additions & 0 deletions .idea/sensu-elasticsearch-check.iml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

## [0.0.1] - 2000-01-01
## [0.1.0] - 2025-07-24

### Added
- Initial release
Loading
Loading