Skip to content

Commit

Permalink
ci: Add goreleaser (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre authored May 1, 2021
1 parent 66a986b commit c81db10
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
before:
hooks:
- go mod download
builds:
- main: ./cmd/main.go
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- replacements:
darwin: macOS
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
brews:
- tap:
owner: bjerkio
name: homebrew-tools
commit_author:
name: Bjerk AS
email: [email protected]
homepage: https://github.com/bjerkio/stackie
description: Manage your DevOps configs with ease
folder: Formula
snapshot:
name_template: '{{ .Tag }}-next'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
13 changes: 11 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
env:
GOLANG_VERSION: 1.16
jobs:
build-tag-release:
name: Build, tag, and release assets
Expand All @@ -23,11 +25,18 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16'
go-version: ${{ env.GOLANG_VERSION }}
- name: Setup build cache
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
# TODO: Add goreleaser?
- name: Release
if: ${{ steps.release.outputs.release_created }}
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --config=.github/goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.BJERKBOT_GITHUB_TOKEN }}

0 comments on commit c81db10

Please sign in to comment.