File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 1
1
yubikey-touch-detector
2
2
dist
3
+ vendor
Original file line number Diff line number Diff line change @@ -10,27 +10,44 @@ GO_GCFLAGS := "all=-trimpath=${PWD}"
10
10
GO_ASMFLAGS := "all=-trimpath=${PWD}"
11
11
GO_LDFLAGS := "-extldflags ${LDFLAGS}"
12
12
13
+ .PHONY : local
14
+ local : vendor build
15
+
13
16
.PHONY : build
14
17
build : main.go detector/ notifier/
15
- go build -ldflags $(GO_LDFLAGS ) -gcflags $(GO_GCFLAGS ) -asmflags $(GO_ASMFLAGS ) -o $(BIN ) main.go
18
+ go build -mod vendor -ldflags $(GO_LDFLAGS ) -gcflags $(GO_GCFLAGS ) -asmflags $(GO_ASMFLAGS ) -o $(BIN ) main.go
19
+
20
+ .PHONY : vendor
21
+ vendor :
22
+ go mod tidy
23
+ go mod vendor
16
24
17
25
.PHONY : clean
18
26
clean :
19
27
rm -f " $( BIN) "
20
28
rm -rf dist
29
+ rm -rf vendor
21
30
22
31
.PHONY : dist
23
- dist : clean build
24
- mkdir -p dist
32
+ dist : clean vendor build
33
+ $(eval TMP := $(shell mktemp -d) )
34
+ mkdir " $( TMP) /$( BIN) -$( VERSION) "
35
+ cp -r * " $( TMP) /$( BIN) -$( VERSION) "
36
+ (cd " $( TMP) " && tar -cvzf " $( BIN) -$( VERSION) -src.tar.gz" " $( BIN) -$( VERSION) " )
25
37
26
- git archive -o "dist/$(BIN)-$(VERSION).tar.gz" --format tar.gz --prefix "$(BIN)-$(VERSION)/" "$(VERSION)"
38
+ mkdir "$(TMP)/$(BIN)-$(VERSION)-linux64"
39
+ cp "$(BIN)" "$(BIN).service" LICENSE README.md "$(TMP)/$(BIN)-$(VERSION)-linux64"
40
+ (cd "$(TMP)" && tar -cvzf "$(BIN)-$(VERSION)-linux64.tar.gz" "$(BIN)-$(VERSION)-linux64")
27
41
28
- tar -cvzf "dist/$(BIN)-$(VERSION)-linux64.tar.gz" "$(BIN)" "$(BIN).service" LICENSE README.md
42
+ mkdir -p dist
43
+ mv "$(TMP)/$(BIN)-$(VERSION)"-*.tar.gz dist
44
+ git archive -o "dist/$(BIN)-$(VERSION).tar.gz" --format tar.gz --prefix "$(BIN)-$(VERSION)/" "$(VERSION)"
29
45
30
46
for file in dist/*; do \
31
47
gpg --detach-sign --armor "$$file"; \
32
48
done
33
49
50
+ rm -rf "$(TMP)"
34
51
rm -f "dist/$(BIN)-$(VERSION).tar.gz"
35
52
36
53
.PHONY : install
You can’t perform that action at this time.
0 commit comments