-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (41 loc) · 2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
default: test
ci: depsdev test
test: cert
go test ./... -coverprofile=coverage.out -covermode=count
lint:
golangci-lint run ./...
depsdev:
go install github.com/Songmu/ghch/cmd/ghch@latest
go install github.com/Songmu/gocredits/cmd/gocredits@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install github.com/bufbuild/buf/cmd/buf@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
testclient: depsdev
mkdir -p testdata/routeguide
mkdir -p testdata/hello
cd testdata/ && protoc --go_out=routeguide --go_opt=paths=source_relative --go-grpc_out=routeguide --go-grpc_opt=paths=source_relative route_guide.proto
cd testdata/ && protoc --go_out=hello --go_opt=paths=source_relative --go-grpc_out=hello --go-grpc_opt=paths=source_relative hello.proto
cd testdata/bsr/protobuf && buf mod update && buf generate
cert:
rm -f testdata/*.pem testdata/*.srl
openssl req -x509 -newkey rsa:4096 -days 365 -nodes -sha256 -keyout testdata/cakey.pem -out testdata/cacert.pem -subj "/C=UK/ST=Test State/L=Test Location/O=Test Org/OU=Test Unit/CN=*.example.com/emailAddress=k1low@pepabo.com"
openssl req -newkey rsa:4096 -nodes -keyout testdata/key.pem -out testdata/csr.pem -subj "/C=JP/ST=Test State/L=Test Location/O=Test Org/OU=Test Unit/CN=*.example.com/emailAddress=k1low@pepabo.com"
openssl x509 -req -sha256 -in testdata/csr.pem -days 60 -CA testdata/cacert.pem -CAkey testdata/cakey.pem -CAcreateserial -out testdata/cert.pem -extfile testdata/openssl.cnf
openssl verify -CAfile testdata/cacert.pem testdata/cert.pem
prerelease:
git pull origin main --tag
go mod tidy
ghch -w -N ${VER}
gocredits -w .
git add CHANGELOG.md CREDITS go.mod go.sum
git commit -m'Bump up version number'
git tag ${VER}
prerelease_for_tagpr: depsdev
go mod tidy
gocredits -w .
git add CHANGELOG.md CREDITS go.mod go.sum
release:
git push origin main --tag
.PHONY: default test