-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from tcnksm/gomod
introduce go modules
- Loading branch information
Showing
481 changed files
with
1,603 additions
and
230,083 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
language: go | ||
sudo: false | ||
go: | ||
- 1.10.x | ||
- 1.11.x | ||
- 1.x | ||
env: | ||
global: | ||
- secure: "c7Owhq9NWblgnQLvmkssks3j4zNPCvgkkagVcuz3GmhcklVrZqY3H57FNepT3pkTYt+EJgqocBoohZodVFXsn917DcrMHETO6enDLUvmsJTTdxVFIU6ylr79NLTfNSJFY//gCe3WiMPw7bEePrAP1o2zMCvK21bZoHN6r48VHgY=" | ||
os: | ||
- linux | ||
- osx | ||
install: | ||
- echo "skipping travis default" | ||
script: | ||
- make test-all | ||
after_script: | ||
- goveralls |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,67 +1,83 @@ | ||
VERSION = $(shell gobump show -r) | ||
COMMIT = $(shell git describe --always) | ||
VERSION = $(shell godzil show-version) | ||
COMMIT = $(shell git rev-parse --short HEAD) | ||
EXTERNAL_TOOLS = \ | ||
github.com/Songmu/goxz/cmd/goxz \ | ||
github.com/motemen/gobump \ | ||
github.com/Songmu/ghch/cmd/ghch | ||
golang.org/x/lint/golint \ | ||
github.com/Songmu/godzil/cmd/godzil \ | ||
github.com/mattn/goveralls \ | ||
github.com/Songmu/gocredits/cmd/gocredits \ | ||
golang.org/x/tools/cmd/cover | ||
|
||
ifdef update | ||
u=-u | ||
endif | ||
|
||
export GO111MODULE=on | ||
|
||
.PHONY: default | ||
default: test | ||
|
||
.PHONY: deps | ||
deps: | ||
go get ${u} -d | ||
go mod tidy | ||
|
||
# install external tools for this project | ||
bootstrap: | ||
.PHONY: devel-deps | ||
devel-deps: deps | ||
@for tool in $(EXTERNAL_TOOLS) ; do \ | ||
echo "Installing $$tool" ; \ | ||
go get $$tool; \ | ||
GO111MODULE=off go get $$tool; \ | ||
done | ||
|
||
# build generate binary on './bin' directory. | ||
.PHONY: build | ||
build: | ||
go build -ldflags "-X main.GitCommit=$(COMMIT)" -o bin/ghr | ||
|
||
bump: bootstrap | ||
@sh -c "'$(CURDIR)/scripts/bump.sh'" | ||
.PHONY: bump | ||
bump: devel-deps | ||
godzil release | ||
|
||
CREDITS: go.sum devel-deps | ||
gocredits -w | ||
|
||
crossbuild: bootstrap | ||
.PHONY: crossbuild | ||
crossbuild: CREDITS | ||
goxz -pv=v${VERSION} -build-ldflags="-X main.GitCommit=${COMMIT}" \ | ||
-arch=386,amd64 -d=./pkg/dist/v${VERSION} | ||
cd pkg/dist/v${VERSION} && shasum -a 256 * > ./v${VERSION}_SHASUMS | ||
|
||
# install installs binary on $GOPATH/bin directory. | ||
.PHONY: install | ||
install: | ||
go install -ldflags "-X main.GitCommit=$(COMMIT)" | ||
|
||
# package runs compile.sh to run gox and zip them. | ||
# Artifacts will be generated in './pkg' directory | ||
package: bootstrap | ||
@sh -c "'$(CURDIR)/scripts/package.sh'" | ||
|
||
brew: package | ||
go run release/main.go v$(VERSION) pkg/dist/v$(VERSION)/ghr_v$(VERSION)_darwin_amd64.zip > ../homebrew-ghr/ghr.rb | ||
|
||
upload: build bootstrap | ||
.PHONY: upload | ||
upload: build devel-deps | ||
bin/ghr -v | ||
bin/ghr v$(VERSION) pkg/dist/v$(VERSION) | ||
|
||
test-all: vet lint test | ||
.PHONY: test-all | ||
test-all: lint test | ||
|
||
test: | ||
.PHONY: test | ||
test: deps | ||
go test -v -parallel=4 ./... | ||
|
||
.PHONY: test-race | ||
test-race: | ||
go test -v -race ./... | ||
|
||
vet: | ||
.PHONY: lint | ||
lint: devel-deps | ||
go vet ./... | ||
golint -set_exit_status ./... | ||
|
||
lint: | ||
@go get github.com/golang/lint/golint | ||
go list ./... | grep -v vendor | xargs -n1 golint -set_exit_status | ||
|
||
.PHONY: cover | ||
cover: | ||
@go get golang.org/x/tools/cmd/cover | ||
go test -coverprofile=cover.out | ||
go tool cover -html cover.out | ||
rm cover.out | ||
|
||
release: bump package upload | ||
|
||
.PHONY: bootstrap bump crossbuild build install package brew test test-race test-all vet lint cover release | ||
.PHONY: release | ||
release: bump crossbuild upload |
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.