Skip to content

Commit

Permalink
Add goreleaser
Browse files Browse the repository at this point in the history
Signed-off-by: Eytan Avisror <[email protected]>
  • Loading branch information
Eytan Avisror authored and Eytan Avisror committed Apr 8, 2022
1 parent dbb7be8 commit 5f32b67
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release aws-auth binaries

on:
release:
types: [created]

jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@master

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ^1.17

- name: GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# TODO: Test using krew-release-bot later

# - name: Update new version in krew-index
# uses: rajatjindal/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
go-version: ^1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bin/*
coverage.txt
coverage.html
coverage.html
dist/
24 changes: 24 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
- go mod tidy
- go generate ./...
builds:
- id: aws-auth
main: ./
binary: aws-auth
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- builds:
- aws-auth
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
wrap_in_directory: false
format: tar.gz
files:
- LICENSE

0 comments on commit 5f32b67

Please sign in to comment.