Skip to content

Commit 2f09dfd

Browse files
committed
Update makefiles
1 parent 8e35a26 commit 2f09dfd

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

.make/common.mk

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,39 +41,50 @@ diff: ## Show the git diff
4141
help: ## Show this help message
4242
@egrep -h '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
4343

44+
install-releaser: ## Install the GoReleaser application
45+
@echo "installing GoReleaser..."
46+
@curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
47+
4448
release:: ## Full production release (creates release in Github)
49+
@echo "releasing..."
4550
@test $(github_token)
4651
@export GITHUB_TOKEN=$(github_token) && goreleaser --rm-dist
4752

4853
release-test: ## Full production test release (everything except deploy)
54+
@echo "creating a release test..."
4955
@goreleaser --skip-publish --rm-dist
5056

5157
release-snap: ## Test the full release (build binaries)
58+
@echo "creating a release snapshot..."
5259
@goreleaser --snapshot --skip-publish --rm-dist
5360

5461
replace-version: ## Replaces the version in HTML/JS (pre-deploy)
62+
@echo "replacing version..."
5563
@test $(version)
5664
@test "$(path)"
5765
@find $(path) -name "*.html" -type f -exec sed -i '' -e "s/{{version}}/$(version)/g" {} \;
5866
@find $(path) -name "*.js" -type f -exec sed -i '' -e "s/{{version}}/$(version)/g" {} \;
5967

6068
tag: ## Generate a new tag and push (tag version=0.0.0)
69+
@echo "creating new tag..."
6170
@test $(version)
6271
@git tag -a v$(version) -m "Pending full release..."
6372
@git push origin v$(version)
6473
@git fetch --tags -f
6574

6675
tag-remove: ## Remove a tag if found (tag-remove version=0.0.0)
76+
@echo "removing tag..."
6777
@test $(version)
6878
@git tag -d v$(version)
6979
@git push --delete origin v$(version)
7080
@git fetch --tags
7181

7282
tag-update: ## Update an existing tag to current commit (tag-update version=0.0.0)
83+
@echo "updating tag to new commit..."
7384
@test $(version)
7485
@git push --force origin HEAD:refs/tags/v$(version)
7586
@git fetch --tags -f
7687

7788
update-releaser: ## Update the goreleaser application
78-
@brew update
79-
@brew upgrade goreleaser
89+
@echo "updating GoReleaser application..."
90+
@$(MAKE) install-releaser

.make/go.mk

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,53 @@ WINDOWS=$(BINARY_NAME)-windows.exe
1616
.PHONY: test lint vet install generate
1717

1818
bench: ## Run all benchmarks in the Go application
19+
@echo "running benchmarks..."
1920
@go test -bench=. -benchmem
2021

2122
build-go: ## Build the Go application (locally)
23+
@echo "building go app..."
2224
@go build -o bin/$(BINARY_NAME)
2325

2426
clean-mods: ## Remove all the Go mod cache
27+
@echo "cleaning mods..."
2528
@go clean -modcache
2629

2730
coverage: ## Shows the test coverage
31+
@echo "creating coverage report..."
2832
@go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out
2933

3034
generate: ## Runs the go generate command in the base of the repo
35+
@echo "generating files..."
3136
@go generate -v
3237

3338
godocs: ## Sync the latest tag with GoDocs
39+
@echo "syndicating to GoDocs..."
3440
@test $(GIT_DOMAIN)
3541
@test $(REPO_OWNER)
3642
@test $(REPO_NAME)
3743
@test $(VERSION_SHORT)
3844
@curl https://proxy.golang.org/$(GIT_DOMAIN)/$(REPO_OWNER)/$(REPO_NAME)/@v/$(VERSION_SHORT).info
3945

4046
install: ## Install the application
47+
@echo "installing binary..."
4148
@go build -o $$GOPATH/bin/$(BINARY_NAME)
4249

4350
install-go: ## Install the application (Using Native Go)
51+
@echo "installing package..."
4452
@go install $(GIT_DOMAIN)/$(REPO_OWNER)/$(REPO_NAME)
4553

4654
lint: ## Run the golangci-lint application (install if not found)
55+
@echo "installing golangci-lint..."
4756
@#Travis (has sudo)
48-
@if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.0 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi;
57+
@if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.1 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi;
4958
@#AWS CodePipeline
50-
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.0; fi;
59+
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.1; fi;
5160
@#Github Actions
52-
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.42.0; fi;
61+
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.42.1; fi;
5362
@#Brew - MacOS
5463
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(shell command -v brew)" != "" ]; then brew install golangci-lint; fi;
64+
@#MacOS Vanilla
65+
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(shell command -v brew)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- v1.42.1; fi;
5566
@echo "running golangci-lint..."
5667
@golangci-lint run --verbose
5768

@@ -61,6 +72,7 @@ test: ## Runs lint and ALL tests
6172
@go test ./... -v
6273

6374
test-unit: ## Runs tests and outputs coverage
75+
@echo "running unit tests..."
6476
@go test ./... -race -coverprofile=coverage.txt -covermode=atomic
6577

6678
test-short: ## Runs vet, lint and tests (excludes integration tests)
@@ -88,6 +100,7 @@ test-no-lint: ## Runs just tests
88100
@go test ./... -v
89101

90102
uninstall: ## Uninstall the application (and remove files)
103+
@echo "uninstalling go application..."
91104
@test $(BINARY_NAME)
92105
@test $(GIT_DOMAIN)
93106
@test $(REPO_OWNER)
@@ -97,11 +110,13 @@ uninstall: ## Uninstall the application (and remove files)
97110
@rm -rf $$GOPATH/bin/$(BINARY_NAME)
98111

99112
update: ## Update all project dependencies
113+
@echo "updating dependencies..."
100114
@go get -u ./... && go mod tidy
101115

102116
update-linter: ## Update the golangci-lint package (macOS only)
117+
@echo "upgrading golangci-lint..."
103118
@brew upgrade golangci-lint
104119

105120
vet: ## Run the Go vet application
106121
@echo "running go vet..."
107-
@go vet -v ./...
122+
@go vet -v ./...

0 commit comments

Comments
 (0)