Skip to content

Commit

Permalink
Switched from go-flags to kingpin for flag-parsing
Browse files Browse the repository at this point in the history
Also configured Goreleaser to automate releases.
  • Loading branch information
Steven Xie committed Nov 28, 2018
1 parent def543f commit 234e38d
Show file tree
Hide file tree
Showing 24 changed files with 625 additions and 472 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ image:
- Visual Studio 2017

clone_depth: 3
clone_folder: C:\gopath\src\github.com\steven-xie\dgen
clone_folder: C:\gopath\src\github.com\stevenxie\dgen

environment:
GOPATH: C:\gopath
Expand Down
9 changes: 5 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
root = true

[*]
# Indent rules
charset = utf-8

## Indent rules:
indent_style = space
indent_size = 2

# Line endings and spacing
## Line endings and spacing:
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

# Golang and Makefile require indents
## Golang and Makefile require indents.
[{*.go,Makefile}]
indent_style = tab
charset = utf-8

[*.go]
tab_width = 2
Expand Down
51 changes: 31 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,51 @@
## ----- REPOSITORY -----
## The compiled binary (excluding Go source files)
/dgen*
!/dgen*.*
/dgen*.exe
## [Repository]
coverage.out

## ---- CODECOV -----
coverage.txt
## The compiled binary (excluding Go source files):
/build/
/dist/
/*begone*
!/*begone*/
!/*begone*.go
## Secrets:
.env

## ----- GO -----
## Binaries for programs and plugins

## [Go]
## Binaries for programs and plugins:
*.exe
*.exe~
*.dll
*.so
*.dylib

## Test binary, build with `go test -c`
## Test binary, build with `go test -c`.
*.test

## Output of the go coverage tool, specifically when used with LiteIDE
## Output of the go coverage tool, specifically when used with LiteIDE.
*.out
## Vendored packages.
vendor/


## ----- OS -----
## System Files – Mac OS X
## [System Files]
## macOS:
.DS_Store
.DS_Store?
*.swp

## System Files – Windows
## Windows:
Thumbs.db

## ----- IDE -----
## VSCode (keeping workspace configurations)
.vscode/
## VSCode (keeping workspace configurations):
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
#!.vscode/launch.json
!.vscode/extensions.json

## IntelliJ
.idea/


## [Miscellaneous]
## git-secret:
.gitsecret/keys/random_seed
90 changes: 90 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
## Scripts to run before anything else..
before:
hooks:
- go mod download
## If Go code needs to be generated:
# - go generate ./...

## Configure how the binaries are built.
builds:
- env:
- CGO_ENABLED=0
goos:
- windows
- darwin
- linux

ldflags:
- "-X github.com/stevenxie/dgen/cmd.Version={{.Version}}"


## Create an archive with built binaries and the README, license, etc.
archive:
name_template: "{{.ProjectName}}-{{.Version}}-{{.Os}}-{{.Arch}}"
wrap_in_directory: true

replacements:
darwin: macOS
linux: linux
windows: win
i386: 386
amd64: x86_64

## Pack archive on 'tar.gz' format on all platforms except Windows.
format: "tar.gz"
format_overrides:
- goos: windows
format: zip

files:
- LICENSE*
- README*
- autocomplete/**/*

## Create a checksums file to allow verifying the integrity of the downloads.
checksum:
name_template: checksums.txt

## Generate a changelog using recent commits.
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

## Create a project snapshot without releasing.
snapshot:
name_template: "{{.ShortCommit}}-SNAPSHOT"

## Release to Github Releases.
release:
name_template: "{{.ProjectName}}-{{.Tag}}"

## Release to Homebrew.
brew:
## Formula information:
description: A CLI tool for repeating a string an excessive number of times.
homepage: https://github.com/stevenxie/dgen

## Custom install / test scripts:
install: |
bin.install "dgen"
bash_completion.install "autocomplete/bash/dgen"
zsh_completion.install "autocomplete/zsh/dgen"
test: dgen --version

## Brew tap information:
github:
owner: stevenxie
name: homebrew-tap

# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: goreleaser-bot
email: dev@stevenxie.me

## Where to put formula inside tap repository.
folder: Formula
Loading

0 comments on commit 234e38d

Please sign in to comment.