@@ -3,6 +3,7 @@ export GO111MODULE=on
3
3
export GOFLAGS=-mod =vendor
4
4
5
5
VERSION =$(shell git describe --tags --match=v* --always --dirty)
6
+ SEMVER =$(shell git describe --tags --match=v* --always --dirty | cut -c 2-)
6
7
7
8
.PHONY : all
8
9
all : build test vet lint fmt
@@ -46,8 +47,13 @@ clean:
46
47
release : \
47
48
clean \
48
49
_output/plugin-linux-amd64.tar.gz \
50
+ _output/plugin-linux-arm64.tar.gz \
49
51
_output/plugin-darwin-amd64.tar.gz \
50
- _output/plugin-windows-amd64.tar.gz
52
+ _output/plugin-windows-amd64.tar.gz \
53
+ _output/plugin-linux_amd64.zip \
54
+ _output/plugin-linux_arm64.zip \
55
+ _output/plugin-darwin_amd64.zip \
56
+ _output/plugin-windows_amd64.zip
51
57
52
58
_output/plugin-% .tar.gz : NAME=terraform-provider-matchbox-$(VERSION ) -$*
53
59
_output/plugin-% .tar.gz : DEST=_output/$(NAME )
@@ -56,12 +62,37 @@ _output/plugin-%.tar.gz: _output/%/terraform-provider-matchbox
56
62
@cp _output/$* /terraform-provider-matchbox $(DEST )
57
63
@tar zcvf $(DEST ) .tar.gz -C _output $(NAME )
58
64
65
+ _output/plugin-% .zip : NAME=terraform-provider-matchbox_$(SEMVER ) _$*
66
+ _output/plugin-% .zip : DEST=_output/$(NAME )
67
+ _output/plugin-% .zip : _output/% /terraform-provider-matchbox
68
+ @mkdir -p $(DEST )
69
+ @cp _output/$* /terraform-provider-matchbox $(DEST ) /terraform-provider-matchbox_$(VERSION )
70
+ @zip -j $(DEST ) .zip $(DEST ) /terraform-provider-matchbox_$(VERSION )
71
+
59
72
_output/linux-amd64/terraform-provider-matchbox : GOARGS = GOOS=linux GOARCH=amd64
73
+ _output/linux-arm64/terraform-provider-matchbox : GOARGS = GOOS=linux GOARCH=arm64
60
74
_output/darwin-amd64/terraform-provider-matchbox : GOARGS = GOOS=darwin GOARCH=amd64
61
75
_output/windows-amd64/terraform-provider-matchbox : GOARGS = GOOS=windows GOARCH=amd64
62
76
_output/% /terraform-provider-matchbox :
63
77
$(GOARGS ) go build -o $@ github.com/poseidon/terraform-provider-matchbox
64
78
79
+ release-sign :
80
+ cd _output; sha256sum * .zip > terraform-provider-matchbox_$(SEMVER ) _SHA256SUMS
81
+ gpg2 --armor --detach-sign _output/terraform-provider-matchbox-$(VERSION ) -linux-amd64.tar.gz
82
+ gpg2 --armor --detach-sign _output/terraform-provider-matchbox-$(VERSION ) -linux-arm64.tar.gz
83
+ gpg2 --armor --detach-sign _output/terraform-provider-matchbox-$(VERSION ) -darwin-amd64.tar.gz
84
+ gpg2 --armor --detach-sign _output/terraform-provider-matchbox-$(VERSION ) -windows-amd64.tar.gz
85
+ gpg2 --detach-sign _output/terraform-provider-matchbox_$(SEMVER ) _SHA256SUMS
86
+
87
+ release-verify : NAME=_output/terraform-provider-matchbox
88
+ release-verify :
89
+ gpg2 --verify $(NAME ) -$(VERSION ) -linux-amd64.tar.gz.asc $(NAME ) -$(VERSION ) -linux-amd64.tar.gz
90
+ gpg2 --verify $(NAME ) -$(VERSION ) -linux-arm64.tar.gz.asc $(NAME ) -$(VERSION ) -linux-arm64.tar.gz
91
+ gpg2 --verify $(NAME ) -$(VERSION ) -darwin-amd64.tar.gz.asc $(NAME ) -$(VERSION ) -darwin-amd64.tar.gz
92
+ gpg2 --verify $(NAME ) -$(VERSION ) -windows-amd64.tar.gz.asc $(NAME ) -$(VERSION ) -windows-amd64.tar.gz
93
+ gpg2 --verify $(NAME ) _$(SEMVER ) _SHA256SUMS.sig $(NAME ) _$(SEMVER ) _SHA256SUMS
94
+
95
+
65
96
.PHONY : certificates
66
97
certificates :
67
98
@openssl req -days 3650 -nodes -x509 -config matchbox/testdata/certs.ext -extensions v3_ca -newkey rsa:4096 -keyout matchbox/testdata/ca.key -out matchbox/testdata/ca.crt -subj " /CN=fake-ca"
0 commit comments