From f5047a68e3d2f8b96368dc94775696c54be7d077 Mon Sep 17 00:00:00 2001 From: "Dr. Ogg" Date: Wed, 25 Aug 2021 13:16:17 -0700 Subject: [PATCH] adding workflow --- .github/release.yml | 26 ++++++++++++++++++++++++++ .goreleaser.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..a849779 --- /dev/null +++ b/.github/release.yml @@ -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.14.x + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..8b9287d --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,41 @@ +builds: + # List of builds + - # First Build + env: + - CGO_ENABLED=0 + main: main.go + ldflags: '-s -w -X github.com/sensu-community/sensu-plugin-sdk/version.version={{.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 + - linux + - windows + goarch: + - amd64 + - arm + - arm64 + goarm: + - 5 + - 6 + - 7 + targets: + - darwin_amd64 + - linux_amd64 + - linux_arm_5 + - linux_arm_6 + - linux_arm_7 + - linux_arm64 + - windows_amd64 + +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_sha512-checksums.txt" + algorithm: sha512 + +archives: + - id: tar + format: tar.gz + files: + - LICENSE + - README.md + - CHANGELOG.md \ No newline at end of file