Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit c75d829

Browse files
committed
Issue #93: print SHA-256 sum of compiled binaries
1 parent 664dacd commit c75d829

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ go_import_path: github.com/bpicode/fritzctl
99

1010
script:
1111
- export FRITZCTL_VERSION=0.0.1-unofficial-ci-travis
12-
- make clean all
12+
- make clean all dist_all
1313

1414
after_success:
1515
- bash <(curl -s https://codecov.io/bash)

Makefile

+12-13
Original file line numberDiff line numberDiff line change
@@ -138,24 +138,23 @@ codequality:
138138

139139
dist_all: dist_linux dist_darwin dist_win
140140

141-
dist_darwin:
142-
@echo -n ">> BUILD, darwin/amd64"
143-
@(GOOS=darwin GOARCH=amd64 go build -o build/distributions/darwin_amd64/fritzctl $(LDFLAGS))
141+
define dist
142+
@echo -n ">> BUILD, $(1)/$(2) "
143+
@(GOOS=$(1) GOARCH=$(2) go build -o $(3) $(LDFLAGS))
144+
@cp $(3) build/distributions/fritzctl-$(1)-$(2)$(4)
145+
@cd build/distributions && shasum -a 256 "fritzctl-$(1)-$(2)$(4)" | tee "fritzctl-$(1)-$(2)$(4).sha256" | cut -b 1-40 -z
144146
@$(call ok)
147+
endef
148+
149+
dist_darwin:
150+
@$(call dist,darwin,amd64,build/distributions/darwin_amd64/fritzctl,"")
145151

146152
dist_win:
147-
@echo -n ">> BUILD, windows/amd64"
148-
@(GOOS=windows GOARCH=amd64 go build -o build/distributions/windows_amd64/fritzctl.exe $(LDFLAGS))
149-
@$(call ok)
153+
@$(call dist,windows,amd64,build/distributions/windows_amd64/fritzctl.exe,".exe")
150154

151155
dist_linux:
152-
@echo -n ">> BUILD, linux/amd64"
153-
@(GOOS=linux GOARCH=amd64 go build -o build/distributions/linux_amd64/usr/bin/fritzctl $(LDFLAGS))
154-
@$(call ok)
155-
156-
@echo -n ">> BUILD, linux/arm"
157-
@(GOOS=linux GOARCH=arm GOARM=6 go build -o build/distributions/linux_arm/usr/bin/fritzctl $(LDFLAGS))
158-
@$(call ok)
156+
@$(call dist,linux,amd64,build/distributions/linux_amd64/usr/bin/fritzctl,"")
157+
@$(call dist,linux,arm,build/distributions/linux_arm/usr/bin/fritzctl,"")
159158

160159
pkg_all: pkg_linux pkg_darwin pkg_win
161160

0 commit comments

Comments
 (0)