Skip to content

Commit

Permalink
Added goreleaser workflow to create releases on tag pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinmwinuka committed Feb 25, 2024
1 parent fbb0b8d commit f7164cf
Show file tree
Hide file tree
Showing 3 changed files with 91 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:
- "*"

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ bin
volumes
/config/
/coverage/

dist/
59 changes: 59 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
version: 1

before:
hooks:
- go mod tidy
- go generate ./...

builds:
- main: ./src
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
flags:
- -mod=vendor

brews:
- name: echovault
homepage: https://github.com/EchoVault/EchoVault
tap:
owner: EchoVault
name: Homebrew-EchoVault
commit_author:
name: kelvinmwinuka
email: [email protected]

release:
prerelease: auto

universal_binaries:
- replace: true

checksum:
name_template: 'checksums.txt'

archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

0 comments on commit f7164cf

Please sign in to comment.