Skip to content

Commit

Permalink
feat: implement go-assets-builder generate command
Browse files Browse the repository at this point in the history
  • Loading branch information
sundowndev committed Apr 16, 2020
1 parent 6302237 commit 2055637
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,34 @@ jobs:
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 12.16.x

- name: Building static assets
run: (cd client && yarn && yarn build)

- name: Build
run: |
go get -v github.com/jessevdk/go-assets-builder
go generate ./...
go build -v .
- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.24.0
./bin/golangci-lint run -D errcheck
- name: Test
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,23 @@ jobs:

- name: Unshallow
run: git fetch --prune --unshallow

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 12.16.x

- name: Building static assets
run: |
cd client
yarn
yarn build
run: (cd client && yarn && yarn build)

- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14.x
# - name: Install packr2
# run: |
# go get -u github.com/gobuffalo/packr/v2/packr2

- name: Install go-assets-builder
run: |
go get -v github.com/jessevdk/go-assets-builder
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
Expand Down
7 changes: 2 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go get -u github.com/gobuffalo/packr/v2/packr2
- go generate ./...
- go mod download
builds:
- env:
- CGO_ENABLED=0
Expand All @@ -16,8 +15,6 @@ builds:
- amd64
- arm
- arm64
hooks:
pre: $HOME/go/bin/packr2
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
Expand Down
2 changes: 1 addition & 1 deletion api/server.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go-assets-builder client/dist -o api/assets.go -p api
//go:generate $GOPATH/bin/go-assets-builder ../client/dist -o ./assets.go -p api
package api

import (
Expand Down

0 comments on commit 2055637

Please sign in to comment.