-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile.yml
45 lines (45 loc) · 1.27 KB
/
makefile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cli: bash
vars:
buildCmd: go build -mod vendor -ldflags "-X main.BuildName=$PACKAGENAME -X main.BuildVersion=$VERSION"
package_name: gomake
package: github.com/efimovalex/gomake
GOGET: go get
version: "v1.0.3"
env:
GO111MODULE: "on"
VERSION: ${version}
PACKAGENAME: ${package_name}
targets:
# builds the binary and installs it in GOBIN
build: |
${buildCmd} -o ${package_name} ${package}
go install ${package}
# removes any development artifacts
clean: rm -rf ${package_name} coverage.out dist
# resoves and adds dependencies to vendor
deps: |
go mod tidy
go mod vendor
# various golang code quality checks
check: |
go fmt ${package}
go fix ${package}
go vet ${package}
golint .
misspell .s
gocyclo -top=10 .
# creates a new release on github & updates brew tap
release: |
git tag -a $VERSION -m "Release $VERSION"
git push origin $VERSION
goreleaser --rm-dist
# git shortcut to commit everything
push: |
git add .
read -p "commit message? " message
git commit -m "${message}"
git push origin master
# test entry
test t: |
echo "Test"
echo "$VERSION"