Skip to content

Commit

Permalink
Created goreleaser config for distributing release binaries on tag pu…
Browse files Browse the repository at this point in the history
…shes
  • Loading branch information
kelvinmwinuka committed Feb 23, 2024
1 parent 0e078e6 commit 924a4aa
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
@@ -1 +1,3 @@
.idea

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-cli
homepage: https://github.com/EchoVault/EchoVault-CLI
tap:
owner: EchoVault
name: Homebrew-EchoVault
commit_author:
name: kelvinmwinuka
email: kelvin@echovault.io

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 924a4aa

Please sign in to comment.