This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: build and goimports (#155)
- Loading branch information
Showing
33 changed files
with
229 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ dist/ | |
*.db | ||
*.log | ||
/autoscan | ||
/config.yml | ||
/config.yml | ||
|
||
/.task/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
version: '3' | ||
|
||
vars: | ||
APP: autoscan | ||
CGO_ENABLED: 0 | ||
GOOS: | ||
sh: go env GOOS | ||
GOARCH: | ||
sh: go env GOARCH | ||
DIST_PATH: dist | ||
BUILD_PATH: "{{.DIST_PATH}}/{{.APP}}_{{.GOOS}}_{{.GOARCH}}" | ||
|
||
env: | ||
GIT_COMMIT: | ||
sh: git rev-parse --short HEAD | ||
TIMESTAMP: '{{now | unixEpoch}}' | ||
VERSION: 0.0.0-dev | ||
|
||
tasks: | ||
test: | ||
desc: Go tests | ||
cmds: | ||
- go test ./... -cover -v -race ${GO_PACKAGES} | ||
|
||
vendor: | ||
desc: Go vendor | ||
sources: | ||
- '**/*.go' | ||
- ./go.sum | ||
cmds: | ||
- go mod vendor | ||
- go mod tidy | ||
|
||
vendor_update: | ||
desc: Go vendor update | ||
cmds: | ||
- go get -u ./... | ||
- task: vendor | ||
|
||
build: | ||
desc: Generate a development binary | ||
dir: '{{.BUILD_PATH}}' | ||
deps: [ vendor ] | ||
cmds: | ||
- | | ||
CGO_ENABLED={{.CGO_ENABLED}} \ | ||
go build \ | ||
-mod vendor \ | ||
-trimpath \ | ||
-ldflags "-s -w -X main.Version=${VERSION} -X main.GitCommit=${GIT_COMMIT} -X main.Timestamp=${TIMESTAMP}" \ | ||
../../cmd/{{.APP}} | ||
release: | ||
desc: Generate a release, but don't publish | ||
cmds: | ||
- goreleaser --skip-validate --skip-publish --rm-dist | ||
|
||
snapshot: | ||
desc: Generate a snapshot release | ||
cmds: | ||
- goreleaser --snapshot --skip-publish --rm-dist | ||
|
||
publish: | ||
desc: Generate a release, and publish | ||
cmds: | ||
- goreleaser --rm-dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ func getBinaryPath() string { | |
} | ||
|
||
return dir | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM sc4h/alpine-s6overlay:3.12 | ||
FROM sc4h/alpine-s6overlay:v2-3.15 | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.