1
0
Fork 0
mirror of https://github.com/kastenhq/kubestr.git synced 2024-12-14 11:57:56 +00:00

Goreleaser (#92)

* create file

* release workflow

* using github token
This commit is contained in:
Sirish Bathina 2021-10-20 14:25:02 -10:00 committed by GitHub
parent ceccf5854f
commit 5f39cc8214
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 13 deletions

View file

@ -5,20 +5,23 @@ on:
types: [created, edited] types: [created, edited]
jobs: jobs:
releases-matrix: goreleaser:
name: Release Go Binary name: Release Go Binary
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/amd64, windows/amd64, darwin/amd64
goos: [linux, windows, darwin]
goarch: [amd64]
steps: steps:
- uses: actions/checkout@v2 - name: Checkout
- uses: wangyoucao577/go-release-action@v1.20 uses: actions/checkout@v2
with: with:
github_token: ${{ secrets.CR_PAT }} fetch-depth: 0
goos: ${{ matrix.goos }} - name: Set up Go
goarch: ${{ matrix.goarch }} uses: actions/setup-go@v2
binary_name: "kubestr" with:
extra_files: LICENSE README.md go-version: 1.17
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
github_token: ${{ secrets.GITHUB_TOKEN }}

35
.goreleaser.yml Normal file
View file

@ -0,0 +1,35 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
builds:
- env:
- CGO_ENABLED=0
- GO_EXTLINK_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'