Skip to content

Commit

Permalink
Add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradley Kemp committed Jun 17, 2019
1 parent d142d64 commit 2a7a483
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 8 deletions.
51 changes: 51 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
before:
hooks:
- go mod download

env:
- GO111MODULE=on

builds:
- &common
goos:
- darwin
- windows
- linux
goarch:
- amd64
ldflags:
- -s -w -X github.com/bradleyjkemp/grpc-tools/internal/versionflag.version={{.Version}}
id: grpc-dump
binary: grpc-dump
main: ./grpc-dump
- <<: *common
id: grpc-fixture
binary: grpc-fixture
main: ./grpc-fixture
- <<: *common
id: grpc-replay
binary: grpc-replay
main: ./grpc-replay
- <<: *common
id: grpc-view
binary: grpc-view
main: ./grpc-view

brews:
-
github:
owner: bradleyjkemp
name: homebrew-formulae
homepage: "https://github.com/bradleyjkemp/grpc-tools"
description: "A suite of gRPC debugging tools. Like Fiddler/Charles but for gRPC."

archives:
- replacements:
darwin: macOS
linux: Linux
windows: Windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ This repository currently includes:
These tools are in alpha so expect breaking changes between releases. See the [changelog](CHANGELOG.md) for full details.

### Installation:
Fetch the tools using:
The recommended way to install these tools is via [Homebrew](https://brew.sh/) using:
```bash
brew install bradleyjkemp/formulae/grpc-tools
```

Alternatively, binaries can be downloaded from the GitHub [releases page](https://github.com/bradleyjkemp/grpc-tools/releases/latest).

Or you can build the tools from source using:
```bash
go install github.com/bradleyjkemp/grpc-tools/...
```
All the tools in this repository will now be installed to your `$GOPATH/bin` or `$GOBIN` directory.

## grpc-dump

Expand Down
10 changes: 4 additions & 6 deletions internal/versionflag/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ import (
"flag"
"fmt"
"os"
"runtime/debug"
)

func init() {
version := "non-module"
if info, ok := debug.ReadBuildInfo(); ok {
version = info.Main.Version
}
var (
version string
)

func init() {
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s (%s):\n", os.Args[0], version)
flag.PrintDefaults()
Expand Down

0 comments on commit 2a7a483

Please sign in to comment.