Skip to content

Commit

Permalink
Add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvalavra committed Sep 1, 2022
1 parent 6eb7fc9 commit 28a31c1
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: goreleaser

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --force --tags

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19

- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
distribution: goreleaser
version: latest
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
project_name: rbac-police
before:
hooks:
- go mod tidy
builds:
- id: rbac-police
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
flags:
- -buildmode=pie
archives:
- builds:
- rbac-police
format: binary
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
checksum:
name_template: 'checksums.txt'
algorithm: sha256
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
filters:
exclude:
- typos?

0 comments on commit 28a31c1

Please sign in to comment.