Skip to content

Commit

Permalink
Merge pull request #368 from suzuki-shunsuke/chore/homebrew
Browse files Browse the repository at this point in the history
chore: publish a homebrew-tap recipe
  • Loading branch information
suzuki-shunsuke committed Oct 24, 2021
2 parents 75d9572 + 0ef1c4b commit 07640d4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yaml
Expand Up @@ -22,6 +22,14 @@ jobs:

- run: go test -v ./... -race -covermode=atomic

- name: Generate token
id: generate_token
if: startsWith(github.ref, 'refs/tags/')
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: remove changes
# Sometimes it is failed to release by goreleaser due to changes of go.sum
run: git checkout -- .
Expand All @@ -37,3 +45,4 @@ jobs:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
34 changes: 34 additions & 0 deletions .goreleaser.yml
Expand Up @@ -16,3 +16,37 @@ builds:
- arm64
release:
prerelease: true
brews:
-
# NOTE: make sure the url_template, the token and given repo (github or gitlab) owner and name are from the
# same kind. We will probably unify this in the next major version like it is done with scoop.

# GitHub/GitLab repository to push the formula to
tap:
owner: suzuki-shunsuke
name: homebrew-aqua
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
# The project name and current git tag are used in the format string.
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
# Your app's homepage.
# Default is empty.
homepage: https://github.com/suzuki-shunsuke/aqua

# Template of your app's description.
# Default is empty.
description: |
Declarative CLI Version manager. Support Lazy Install and Sharable configuration mechanism named Registry. Switch versions seamlessly
license: MIT

# Setting this will prevent goreleaser to actually try to commit the updated
# formula - instead, the formula file will be stored on the dist folder only,
# leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the homebrew tap
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
skip_upload: auto

# So you can `brew test` your formula.
# Default is empty.
test: |
system "#{bin}/aqua --version"

0 comments on commit 07640d4

Please sign in to comment.