Skip to content

Commit

Permalink
Publish homebrew tap forumla to during release via goreleaser.
Browse files Browse the repository at this point in the history
  • Loading branch information
phamann committed Apr 21, 2020
1 parent 58e4f09 commit 716c096
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,29 @@ archives:
<<: *archive_defaults
wrap_in_directory: false
format: zip
brews:
- name: fastly
ids: [nix]
github:
owner: fastly
name: homebrew-tap
skip_upload: auto
description: Fastly CLI
homepage: https://github.com/fastly/cli
folder: Formula
custom_block: |
head do
url "https://github.com/fastly/cli.git"
depends_on "go"
end
install: |
system "make" if build.head?
bin.install "fastly"
(bash_completion/"fastly.sh").write `#{bin}/fastly --completion-script-bash`
(zsh_completion/"_fastly").write `#{bin}/fastly --completion-script-zsh`
test: |
help_text = shell_output("#{bin}/fastly --help")
assert_includes help_text, "Usage:"
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
snapshot:
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
SHELL := /bin/bash -o pipefail

VERSION ?= $(shell git describe --tags 2>/dev/null || git rev-parse --short HEAD)
LDFLAGS = -ldflags "\
-X 'github.com/fastly/cli/pkg/version.AppVersion=${VERSION}' \
-X 'github.com/fastly/cli/pkg/version.GitRevision=$(shell git rev-parse --short HEAD || echo unknown)' \
-X 'github.com/fastly/cli/pkg/version.GoVersion=$(shell go version)' \
"

fastly:
@go build -trimpath $(LDFLAGS) -o "$@" ./cmd/fastly

.PHONY: all
all: fmt vet staticcheck lint gosec test build install

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ A CLI for interacting with the Fastly platform.

## Install

### Homebrew

Install: `brew install fastly/tap/fastly`

Upgrade: `brew upgrade fastly`

### From a prebuilt binary
[Download the latest release][latest] from the [releases page][releases].
Unarchive the binary and place it in your $PATH. You can verify the integrity
of the binary using the SHA256 checksums file `fastly_x.x.x_SHA256SUMS` provided
Expand Down

0 comments on commit 716c096

Please sign in to comment.