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

updated to hopefully fix all the issues #30

Merged
merged 4 commits into from
Jan 16, 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
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: markbates
patreon: buffalo
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release
on:
release:
types:
- published

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
-
name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
-
name: Checkout Code
uses: actions/checkout@master
-
name: Run GoReleaser
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
22 changes: 22 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Tests
on: [push]
jobs:

tests-on:
name: ${{matrix.go-version}} ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout Code
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Test
run: |
go mod tidy -v
go test -race ./...


3 changes: 0 additions & 3 deletions .gometalinter.json

This file was deleted.

58 changes: 36 additions & 22 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,45 @@
# Code generated by github.com/gobuffalo/release. DO NOT EDIT.
# Edit .goreleaser.yml.plush instead

builds:
-
goos:
- darwin
- linux
- windows
env:
- CGO_ENABLED=0
main: main.go

-
main: ./cmd/main.go
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X "github.com/gobuffalo/buffalo-goth/main.Version={{.Tag}}"
goos:
- darwin
- linux
- windows
goarch:
- amd64
- 386
- arm
- arm64
goarm:
- 6
- 7
archives:
-
replacements:
'386': i386
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
checksum:
name_template: 'checksums.txt'

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

name_template: '{{ .Tag }}-next'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

brew:
github:
owner: markbates
name: homebrew-tap

brews:
-
name: 'buffalo-goth'
github:
owner: 'gobuffalo'
name: 'homebrew-tap'
install: |
bin.install "buffalo-goth"
28 changes: 0 additions & 28 deletions .goreleaser.yml.plush

This file was deleted.

34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

42 changes: 4 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,20 @@ TAGS ?= "sqlite"
GO_BIN ?= go

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

tidy:
ifeq ($(GO111MODULE),on)
$(GO_BIN) mod tidy
else
echo skipping go mod tidy
endif

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

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

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

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

lint:
gometalinter --vendor ./... --deadline=1m --skip=internal
make tidy

update:
$(GO_BIN) get -u -tags ${TAGS}
make tidy
packr
make test
make install
make tidy

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

release:
make tidy
release -y -f version.go
make tidy
packr2
6 changes: 3 additions & 3 deletions cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

"github.com/gobuffalo/buffalo-goth/genny/auth"
"github.com/gobuffalo/genny"
"github.com/gobuffalo/genny/movinglater/gotools"
"github.com/gobuffalo/genny/v2"
"github.com/gobuffalo/genny/v2/gogen"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -36,7 +36,7 @@ var authCmd = &cobra.Command{
}
gg.With(r)

g, err := gotools.GoFmt(r.Root)
g, err := gogen.Fmt(r.Root)
if err != nil {
return errors.WithStack(err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

"github.com/gobuffalo/buffalo-goth/genny/goth"
"github.com/gobuffalo/genny"
"github.com/gobuffalo/genny/movinglater/gotools"
"github.com/gobuffalo/genny/v2"
"github.com/gobuffalo/genny/v2/gogen"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -36,7 +36,7 @@ var generateCmd = &cobra.Command{
}
r.With(g)

g, err = gotools.GoFmt(r.Root)
g, err = gogen.Fmt(r.Root)
if err != nil {
return errors.WithStack(err)
}
Expand Down
11 changes: 0 additions & 11 deletions genny/auth/a_auth-packr.go

This file was deleted.

8 changes: 8 additions & 0 deletions genny/auth/auth-packr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions genny/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"text/template"

"github.com/gobuffalo/buffalo-goth/genny/goth"
"github.com/gobuffalo/genny"
"github.com/gobuffalo/genny/movinglater/gotools"
"github.com/gobuffalo/genny/v2"
"github.com/gobuffalo/genny/v2/gogen"
"github.com/gobuffalo/meta"
"github.com/gobuffalo/packr"
"github.com/gobuffalo/packr/v2"
"github.com/pkg/errors"
)

Expand All @@ -26,7 +26,7 @@ func New(opts *Options) (*genny.Group, error) {

g = genny.New()

if err := g.Box(packr.NewBox("../auth/templates")); err != nil {
if err := g.Box(packr.New("", "../auth/templates")); err != nil {
return gg, errors.WithStack(err)
}

Expand All @@ -38,7 +38,7 @@ func New(opts *Options) (*genny.Group, error) {
"providers": opts.Providers,
"app": meta.New("."),
}
t := gotools.TemplateTransformer(data, h)
t := gogen.TemplateTransformer(data, h)
g.Transformer(t)

cmd := exec.Command("buffalo", "db", "generate", "model", "user", "name", "email:nulls.String", "provider", "provider_id")
Expand Down
6 changes: 3 additions & 3 deletions genny/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"testing"

"github.com/gobuffalo/genny"
"github.com/gobuffalo/genny/v2"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -33,9 +33,9 @@ func Test_Auth(t *testing.T) {
r.Equal("actions/app.go", f.Name())
r.Equal(appAfter, f.String())

r.Len(res.Commands, 2)
r.Len(res.Commands, 1)

c := res.Commands[1]
c := res.Commands[0]
r.Equal("buffalo db generate model user name email:nulls.String provider provider_id", strings.Join(c.Args, " "))
}

Expand Down
11 changes: 0 additions & 11 deletions genny/goth/a_goth-packr.go

This file was deleted.

8 changes: 8 additions & 0 deletions genny/goth/goth-packr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading