From f279e149e298ebd6a0287bfa93c6798d3c5dbe34 Mon Sep 17 00:00:00 2001 From: Bruno Ferreira Date: Thu, 27 Oct 2022 01:19:01 +0100 Subject: [PATCH 1/2] add goreleaser to push binaries to brew --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ .goreleaser.yml | 34 ++++++++++++++++++++++++++++++++++ README.md | 6 ++++++ 3 files changed, 70 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..47e6ec7 --- /dev/null +++ b/.github/workflows/release.yml @@ -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.GITHUB_TOKEN }} + TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..33714ce --- /dev/null +++ b/.goreleaser.yml @@ -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:' diff --git a/README.md b/README.md index add0007..b50c37f 100644 --- a/README.md +++ b/README.md @@ -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; From c4904ec518aa89d15d3cad1a8c80805b81fd1e2e Mon Sep 17 00:00:00 2001 From: Ivan Ilves Date: Thu, 27 Oct 2022 14:47:07 +0200 Subject: [PATCH 2/2] Update .github/workflows/release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47e6ec7..ecc6dd0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,5 +26,5 @@ jobs: version: latest args: release --rm-dist env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}