Skip to content

Commit

Permalink
Merge pull request #18 from bmbferreira/add-releases-to-homebrew
Browse files Browse the repository at this point in the history
add goreleaser to push binaries to brew
  • Loading branch information
ivanilves authored Oct 27, 2022
2 parents 5abdc50 + c4904ec commit c065291
Show file tree
Hide file tree
Showing 3 changed files with 70 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@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Set RELEASE_VERSION env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
before:
hooks:
- go mod download
builds:
- goos:
- linux
- darwin
goarch:
- amd64
- arm64
main: ./cmd/travelgrunt/main.go
ldflags:
- -X main.appVersion={{.Env.RELEASE_VERSION}}
brews:
- name: travelgrunt
homepage: 'https://github.com/ivanilves/travelgrunt'
description: 'Travel Terragrunt directory tree as a first class passenger!'
folder: Formula
tap:
owner: ivanilves
name: homebrew-travelgrunt
archives:
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: tar.gz
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ curl -s -f \
| PREFIX=/somewhere/else sh
```

Install with homebrew:
```
brew tap ivanilves/travelgrunt
brew install ivanilves/travelgrunt
```

## How to build?

* `make dep` - install/ensure dependencies;
Expand Down

0 comments on commit c065291

Please sign in to comment.