Skip to content

Commit

Permalink
fix(goreleaser): build with git version info (#53)
Browse files Browse the repository at this point in the history
* test(huobi): add huobi e2e tests

* fix(goreleaser): build with git version info
  • Loading branch information
Triple-Z authored Feb 17, 2022
1 parent f9df096 commit a3d710f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ before:
builds:
- env:
- CGO_ENABLED=0
binary: double-entry-generator
goos:
- linux
- windows
- darwin
ldflags:
- -s -w -X github.com/deb-sig/double-entry-generator/pkg/version.VERSION={{.Version}} -X github.com/deb-sig/double-entry-generator/pkg/version.REPOROOT=github.com/deb-sig/double-entry-generator -X github.com/deb-sig/double-entry-generator/pkg/version.COMMIT={{.ShortCommit}}
archives:
- replacements:
darwin: Darwin
Expand All @@ -20,7 +23,7 @@ archives:
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
name_template: "{{ .Version }}-SNAPSHOT"
changelog:
sort: asc
filters:
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BIN_DIR := $(GOPATH)/bin
GOLANGCI_LINT := $(BIN_DIR)/golangci-lint

# All targets.
.PHONY: lint test build container push help clean test-go test-wechat test-alipay format check-format
.PHONY: lint test build container push help clean test-go test-wechat test-alipay test-huobi test-htsec format check-format goreleaser-build-test

help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
Expand All @@ -65,9 +65,11 @@ install: build ## Install the double-entry-generator binary

clean: ## Clean all the temporary files
@rm -rf ./bin
@rm -rf ./dist
@rm -rf ./test/output
@rm -rf ./double-entry-generator

test: test-go test-alipay test-wechat test-htsec ## Run all tests
test: test-go test-alipay test-wechat test-huobi test-htsec ## Run all tests

test-go: ## Run Golang tests
@go test ./...
Expand All @@ -78,11 +80,17 @@ test-alipay: ## Run tests for Alipay provider
test-wechat: ## Run tests for WeChat provider
@$(SHELL) ./test/wechat-test.sh

test-huobi: ## Run tests for huobi provider
@$(SHELL) ./test/huobi-test.sh

test-htsec: ## Run tests for htsec provider
@$(SHELL) ./test/htsec-test.sh

format: ## Format code
@gofmt -s -w pkg

check-format: ## Check if the format looks good.
@go fmt ./...
@go fmt ./...

goreleaser-build-test: ## Goreleaser build for testing
goreleaser build --single-target --snapshot --rm-dist

0 comments on commit a3d710f

Please sign in to comment.