Skip to content

Commit

Permalink
Add goreleaser configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ksysoev committed Nov 12, 2023
1 parent 36c4103 commit 4d20595
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@

# Go workspace file
go.work

dist/
48 changes: 48 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: 1

project_name: wsget
before:
hooks:
- go mod tidy
builds:
- main: cmd/wsget/main.go
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
ldflags:
- -s -w -X main.Version={{.Version}}
archives:
- name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
release:
github:
owner: ksysoev
name: wsget
name_template: "{{ .Tag }}"
prerelease: auto

brews:
- name: wsget
repository:
owner: ksysoev
name: homebrew-wsget
skip_upload: auto
folder: Formula
homepage: "https://gihub.com/ksysoev/wsget"
description: "wsget binary"
test: |
system "#{bin}/wsget"
install: |
bin.install 'wsget'
3 changes: 2 additions & 1 deletion cmd/wsget/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var request string
var outputFile string
var headers []string
var waitResponse int
var Version = "dev"

const (
LongDescription = `A command-line tool for interacting with WebSocket servers.
Expand Down Expand Up @@ -47,7 +48,7 @@ func main() {
Example: `wsget wss://ws.postman-echo.com/raw -r "Hello, world!"`,
Args: cobra.ExactArgs(1),
ArgAliases: []string{"url"},
Version: "0.2.1",
Version: Version,
Run: run,
}

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ require (
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
github.com/fatih/color v1.15.0
github.com/spf13/cobra v1.7.0
golang.org/x/net v0.17.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/sys v0.13.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 4d20595

Please sign in to comment.