Skip to content

Commit

Permalink
version bump: v1.6.0
Browse files Browse the repository at this point in the history
markbates committed Jun 13, 2019
1 parent d7fc6af commit a8e775c
Showing 15 changed files with 164 additions and 120 deletions.
28 changes: 28 additions & 0 deletions .goreleaser.yml.plush
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
builds:
-
goos:
- darwin
- linux
- windows
env:
- CGO_ENABLED=0
main: main.go

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
<%= if (brew) { %>
brew:
github:
owner: gobuffalo
name: homebrew-tap
<% } %>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Mark Bates
Copyright (c) 2019 Mark Bates

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
42 changes: 23 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
TAGS ?= "sqlite"
GO_BIN ?= go
TAGS ?= ""
GO_BIN ?= "go"

install:
packr2
$(GO_BIN) install -tags ${TAGS} -v
install: packr
$(GO_BIN) install -tags ${TAGS} -v ./.
make tidy

tidy:
@@ -14,44 +13,49 @@ else
endif

deps:
$(GO_BIN) get github.com/gobuffalo/release
$(GO_BIN) get github.com/gobuffalo/packr/v2/packr2
$(GO_BIN) get -tags ${TAGS} -t ./...
make tidy

build:
packr2
build: packr
$(GO_BIN) build -v .
make tidy

test:
packr2
test: packr
$(GO_BIN) test -cover -tags ${TAGS} ./...
make tidy

ci-deps:
ci-deps: packr
$(GO_BIN) get -tags ${TAGS} -t ./...

ci-test:
ci-test: packr
$(GO_BIN) test -tags ${TAGS} -race ./...

lint:
gometalinter --vendor ./... --deadline=1m --skip=internal
go get github.com/golangci/golangci-lint/cmd/golangci-lint
golangci-lint run --enable-all
make tidy

update:
ifeq ($(GO111MODULE),on)
rm go.*
$(GO_BIN) mod init
$(GO_BIN) mod tidy
else
$(GO_BIN) get -u -tags ${TAGS}
make tidy
packr2
endif
make test
make install
make tidy

release-test:
release-test: packr
$(GO_BIN) test -tags ${TAGS} -race ./...
make tidy

me:
me: install
release -y -f version.go
make tidy
release -y -f ./release/version.go

packr:
$(GO_BIN) get github.com/gobuffalo/packr/v2/packr2
packr2
make tidy
18 changes: 6 additions & 12 deletions cmd/init.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import (

"github.com/gobuffalo/genny"
"github.com/gobuffalo/release/genny/initgen"
"github.com/gobuffalo/release/genny/makefile"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
@@ -14,7 +15,9 @@ var initOptions = struct {
*initgen.Options
dryRun bool
}{
Options: &initgen.Options{},
Options: &initgen.Options{
Options: &makefile.Options{},
},
}

// initCmd represents the init command
@@ -26,7 +29,6 @@ var initCmd = &cobra.Command{
if initOptions.dryRun {
run = genny.DryRunner(context.Background())
}
// run.Logger = logger.New(logger.DebugLevel)

opts := initOptions.Options
pwd, _ := os.Getwd()
@@ -46,16 +48,8 @@ func init() {
rootCmd.AddCommand(initCmd)
initCmd.Flags().BoolVarP(&initOptions.dryRun, "dry-run", "d", false, "runs the generator dry")
initCmd.Flags().BoolVarP(&initOptions.Force, "force", "f", false, "force files to overwrite existing ones")
initCmd.Flags().BoolVarP(&initOptions.WithPackr, "with-packr", "p", false, "use packr2")
initCmd.Flags().StringVarP(&initOptions.MainFile, "main-file", "m", "", "adds a .goreleaser.yml file (only for binary applications)")
initCmd.Flags().StringVarP(&initOptions.VersionFile, "version-file", "v", "version.go", "path to a version file to maintain")

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// initCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// initCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
initCmd.Flags().StringSliceVarP(&initOptions.Tags, "tags", "t", []string{}, "tags for the Makefile")
}
7 changes: 1 addition & 6 deletions genny/initgen/init.go
Original file line number Diff line number Diff line change
@@ -64,12 +64,7 @@ func New(opts *Options) (*genny.Group, error) {
}))

// write a new makefile
g, err = makefile.New(&makefile.Options{
Force: opts.Force,
VersionFile: opts.VersionFile,
MainFile: opts.MainFile,
Root: opts.Root,
})
g, err = makefile.New(opts.Options)
if err != nil {
return gg, errors.WithStack(err)
}
7 changes: 5 additions & 2 deletions genny/initgen/init_test.go
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import (
"github.com/gobuffalo/genny"
"github.com/gobuffalo/genny/gentest"
"github.com/gobuffalo/genny/movinglater/gotools/gomods"
"github.com/gobuffalo/release/genny/makefile"
"github.com/stretchr/testify/require"
)

@@ -15,8 +16,10 @@ func Test_New(t *testing.T) {

gg, err := New(&Options{
VersionFile: "foo/bar/version.go",
MainFile: "./main.go",
Root: ".",
Options: &makefile.Options{
MainFile: "./main.go",
Root: ".",
},
})
r.NoError(err)

4 changes: 2 additions & 2 deletions genny/initgen/options.go
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@ import (
"os"
"path/filepath"

"github.com/gobuffalo/release/genny/makefile"
"github.com/pkg/errors"
)

type Options struct {
*makefile.Options
VersionFile string
Version string
MainFile string
Force bool
Root string
}

// Validate that options are usuable
3 changes: 3 additions & 0 deletions genny/makefile/makefile.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package makefile

import (
"strings"

"github.com/gobuffalo/genny"
"github.com/gobuffalo/packr/v2"
"github.com/gobuffalo/plush"
@@ -23,6 +25,7 @@ func New(opts *Options) (*genny.Generator, error) {

ctx := plush.NewContext()
ctx.Set("opts", opts)
ctx.Set("tags", strings.Join(opts.Tags, " "))
g.Transformer(plushgen.Transformer(ctx))
g.Transformer(genny.Dot())

2 changes: 2 additions & 0 deletions genny/makefile/options.go
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@ type Options struct {
BuildPath string
VersionFile string
Root string
Tags []string
WithPackr bool
}

// Validate that options are usuable
41 changes: 25 additions & 16 deletions genny/makefile/templates/Makefile.plush
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
TAGS ?= "sqlite"
GO_BIN ?= go
TAGS ?= "<%= tags %>"
GO_BIN ?= "go"

install:
packr2
install: <%= if (opts.WithPackr) {return "packr"} %>
$(GO_BIN) install -tags ${TAGS} -v <%= opts.BuildPath %>
make tidy

@@ -14,44 +13,54 @@ else
endif

deps:
$(GO_BIN) get github.com/gobuffalo/release
$(GO_BIN) get github.com/gobuffalo/packr/v2/packr2
$(GO_BIN) get -tags ${TAGS} -t ./...
make tidy

build:
packr2
build: <%= if (opts.WithPackr) {return "packr"} %>
$(GO_BIN) build -v .
make tidy

test:
packr2
test: <%= if (opts.WithPackr) {return "packr"} %>
$(GO_BIN) test -cover -tags ${TAGS} ./...
make tidy

ci-deps:
ci-deps: <%= if (opts.WithPackr) {return "packr"} %>
$(GO_BIN) get -tags ${TAGS} -t ./...

ci-test:
ci-test: <%= if (opts.WithPackr) {return "packr"} %>
$(GO_BIN) test -tags ${TAGS} -race ./...

lint:
gometalinter --vendor ./... --deadline=1m --skip=internal
go get github.com/golangci/golangci-lint/cmd/golangci-lint
golangci-lint run --enable-all
make tidy

update:
ifeq ($(GO111MODULE),on)
rm go.*
$(GO_BIN) mod init
$(GO_BIN) mod tidy
else
$(GO_BIN) get -u -tags ${TAGS}
make tidy
packr2
endif
make test
make install
make tidy

release-test:
release-test: <%= if (opts.WithPackr) {return "packr"} %>
$(GO_BIN) test -tags ${TAGS} -race ./...
make tidy

release:
$(GO_BIN) get github.com/gobuffalo/release
make tidy
release -y <%= if (opts.VersionFile) { return "-f "+ opts.VersionFile } %>
make tidy
<%= if (opts.WithPackr) { %>
packr:
$(GO_BIN) get github.com/gobuffalo/packr/v2/packr2
packr2
make tidy
<% } %>


4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@ require (
github.com/gobuffalo/genny v0.1.1
github.com/gobuffalo/licenser v1.0.0
github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2
github.com/gobuffalo/packr/v2 v2.3.1
github.com/gobuffalo/packr/v2 v2.3.2
github.com/gobuffalo/plush v3.8.2+incompatible
github.com/gobuffalo/plushgen v0.1.0
github.com/gobuffalo/shoulders v1.0.4
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.4
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.3.0
)
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -50,8 +50,9 @@ github.com/gobuffalo/packd v0.1.0 h1:4sGKOD8yaYJ+dek1FDkwcxCHA40M4kfKgFHx8N2kwbU
github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4=
github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ=
github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0=
github.com/gobuffalo/packr/v2 v2.3.1 h1:tDIfJRaSsyzjpXr4RYhEFmEe5LPvDXZF0yzoHtai+Rw=
github.com/gobuffalo/packr/v2 v2.3.1/go.mod h1:93elRVdDhpUgox9GnXswWK5dzpVBQsnlQjnnncSLoiU=
github.com/gobuffalo/packr/v2 v2.3.2 h1:4tzPh2XZbSkoUX7im83eA8FBA0+dzJhJDvCPMRaH0A4=
github.com/gobuffalo/packr/v2 v2.3.2/go.mod h1:93elRVdDhpUgox9GnXswWK5dzpVBQsnlQjnnncSLoiU=
github.com/gobuffalo/plush v3.8.0+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI=
github.com/gobuffalo/plush v3.8.2+incompatible h1:EXtDf5L7TTwX8tEddtdHT+PT2lFerIKQm8Ye/M7O+54=
github.com/gobuffalo/plush v3.8.2+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI=
@@ -133,8 +134,9 @@ github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.4 h1:S0tLZ3VOKl2Te0hpq8+ke0eSJPfCnNTPiDlsfwi1/NE=
github.com/spf13/cobra v0.0.4/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
114 changes: 57 additions & 57 deletions packrd/packed-packr.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package release

const Version = "v1.5.0"
const Version = "v0.0.1"
4 changes: 4 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package main

// Version of main
const Version = "v1.6.0"

0 comments on commit a8e775c

Please sign in to comment.