Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project: add goreleaser configuration. #374

Merged
merged 2 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@ cmd/zlint-gtld-update/zlint-gtld-update

### Integration test data ###
data

### Goreleaser builds ###
dist
30 changes: 30 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
project_name: zlint
before:
hooks:
- go mod tidy
builds:
-
main: ./cmd/zlint/main.go
binary: zlint
env:
- CGO_ENABLED=0
goos:
- linux
- freebsd
- windows
- darwin
goarch:
- amd64
archives:
-
wrap_in_directory: true
replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
snapshot:
name_template: "{{ .Tag }}-next"
release:
draft: true
prerelease: auto
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ script:
# Run integration tests
- make integration PARALLELISM=3

deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
api_key: $GITHUB_AUTH_TOKEN
draft: true
on:
repo: zmap/zlint
tags: true

notifications:
email:
- dkumar11@illinois.edu
Expand Down
4 changes: 4 additions & 0 deletions cmd/zlint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ var ( // flags
format string
include string
exclude string

// version is replaced by GoReleaser using an LDFlags option at release time.
version = "dev"
)

func init() {
Expand All @@ -50,6 +53,7 @@ func init() {

flag.BoolVar(&prettyprint, "pretty", false, "Pretty-print output")
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "ZLint version %s\n\n", version)
fmt.Fprintf(os.Stderr, "Usage: %s [flags] file...\n", os.Args[0])
flag.PrintDefaults()
}
Expand Down