Skip to content

Commit

Permalink
Add GoReleaser
Browse files Browse the repository at this point in the history
Use GoReleaser to build kuberlr, leverage GitHub actions for that.
  • Loading branch information
flavio committed May 5, 2020
1 parent f0a582f commit d4ea67a
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: goreleaser

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
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 }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# Main project binary
/kuberlr

# go releaser artifacts directory
dist/

# vim swap files
*.swp

Expand Down
32 changes: 32 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
main: ./cmd/kuberlr
ldflags:
- -X=github.com/flavio/kuberlr/pkg/kuberlr.Version={{.Version}}
- -X=github.com/flavio/kuberlr/pkg/kuberlr.BuildDate={{.Date}}
- -X=github.com/flavio/kuberlr/pkg/kuberlr.Tag={{.Tag}}
goarch:
- amd64
- arm
- arm64
archives:
- format_overrides:
- goos: windows
format: zip
wrap_in_directory: true
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit d4ea67a

Please sign in to comment.