Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
修改版本信息显示
Browse files Browse the repository at this point in the history
  • Loading branch information
Becivells committed Apr 21, 2021
1 parent a0bab9d commit 6a4959d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
2 changes: 0 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ gomod:
proxy: true
builds:
- env: [CGO_ENABLED=0]
ldflags:
- -s -w
goos:
- linux
- windows
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ before_install:

script:
- make
- make release
- make test-cli
24 changes: 2 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,8 @@ build: fmt
@echo "build Success!"

.PHONY: release
release: build
@echo "$(CGREEN)Cross platform building for release ...$(CEND)"
@mkdir -p release
@for GOOS in darwin linux windows freebsd netbsd openbsd plan9 solaris; do \
for GOARCH in amd64 386 arm; do \
for d in $$(go list -f '{{if (eq .Name "main")}}{{.ImportPath}}{{end}}' ./...); do \
b=$$(basename $${d}) ; \
if [ "$${GOOS}" = 'windows' ]; then\
echo "Building $${b}.$${GOOS}-$${GOARCH}.exe ..."; \
GOOS=$${GOOS} GOARCH=$${GOARCH} go build ${GCFLAGS} ${LDFLAGS} -v -o release/$${b}.$${GOOS}-$${GOARCH}.exe $$d 2>/dev/null ; \
cd release &&shasum $${b}.$${GOOS}-$${GOARCH}.exe>$${b}.$${GOOS}-$${GOARCH}.exe.shasum && tar -zcf $${b}.$${GOOS}-$${GOARCH}.tar.gz $${b}.$${GOOS}-$${GOARCH}.exe $${b}.$${GOOS}-$${GOARCH}.exe.shasum;\
cd ../; \
else \
echo "Building $${b}.$${GOOS}-$${GOARCH} ..."; \
GOOS=$${GOOS} GOARCH=$${GOARCH} go build ${GCFLAGS} ${LDFLAGS} -v -o release/$${b}.$${GOOS}-$${GOARCH} $$d 2>/dev/null ; \
cd release &&shasum $${b}.$${GOOS}-$${GOARCH}>$${b}.$${GOOS}-$${GOARCH}.shasum && tar -zcf $${b}.$${GOOS}-$${GOARCH}.tar.gz $${b}.$${GOOS}-$${GOARCH} $${b}.$${GOOS}-$${GOARCH}.shasum; \
cd ../; \
fi \
done ; \
done ;\
done
@find ./release/ -type f -a -size 0 -exec rm {} \;
release:
goreleaser release --snapshot --rm-dist

.PHONY: test-cli
test-cli: build
Expand Down

0 comments on commit 6a4959d

Please sign in to comment.