-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from mchmarny/master
Custom go SDK (aka bespoke client proposal)
- Loading branch information
Showing
37 changed files
with
3,514 additions
and
1,336 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # v0.8.1 | ||
|
||
jobs: | ||
|
||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Setup | ||
id: go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.14 | ||
|
||
- name: Checkout | ||
id: setup | ||
uses: actions/checkout@v2 | ||
|
||
- name: Tidy | ||
run: | | ||
go mod tidy | ||
go mod vendor | ||
- name: Test | ||
run: go test -v -count=1 -race ./... | ||
|
||
- name: Version | ||
id: get_version | ||
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10}) | ||
|
||
- name: Release | ||
id: release-step | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: Automatic go Dapr client release | ||
draft: false | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
|
||
build: | ||
name: Test Push | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Setup | ||
id: go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.14 | ||
|
||
- name: Checkout | ||
id: setup | ||
uses: actions/checkout@v2 | ||
|
||
- name: Tidy | ||
run: | | ||
go mod tidy | ||
go mod vendor | ||
- name: Test | ||
run: go test -v -count=1 -race ./... | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
RELEASE_VERSION =v0.8.0 | ||
GDOC_PORT =8888 | ||
PROTO_ROOT =https://raw.githubusercontent.com/dapr/dapr/master/dapr/proto/ | ||
|
||
.PHONY: mod test service client lint protps tag lint docs clean protos help | ||
all: test | ||
|
||
mod: ## Updates the go modules | ||
go mod tidy | ||
|
||
test: mod ## Tests the entire project | ||
go test -v -count=1 -race ./... | ||
# go test -v -count=1 -run NameOfSingleTest ./... | ||
|
||
service: mod ## Runs the uncompiled example service code | ||
dapr run --app-id serving \ | ||
--protocol grpc \ | ||
--app-port 50001 \ | ||
go run example/serving/main.go | ||
|
||
client: mod ## Runs the uncompiled example client code | ||
dapr run --app-id caller \ | ||
--components-path example/client/comp \ | ||
go run example/client/main.go | ||
|
||
lint: ## Lints the entire project | ||
golangci-lint run --timeout=3m | ||
|
||
docs: ## Runs godoc (in container due to mod support) | ||
docker run \ | ||
--rm \ | ||
-e "GOPATH=/tmp/go" \ | ||
-p 127.0.0.1:$(GDOC_PORT):$(GDOC_PORT) \ | ||
-v $(PWD):/tmp/go/src/ \ | ||
--name godoc golang \ | ||
bash -c "go get golang.org/x/tools/cmd/godoc && echo http://localhost:$(GDOC_PORT)/pkg/ && /tmp/go/bin/godoc -http=:$(GDOC_PORT)" | ||
open http://localhost:8888/pkg/client/ | ||
|
||
tag: ## Creates release tag | ||
git tag $(RELEASE_VERSION) | ||
git push origin $(RELEASE_VERSION) | ||
|
||
clean: ## Cleans go and generated files in ./dapr/proto/ | ||
go clean | ||
rm -fr ./dapr/proto/common/v1/* | ||
rm -fr ./dapr/proto/runtime/v1/* | ||
|
||
protos: ## Downloads proto files from dapr/dapr and generats gRPC proto clients | ||
go install github.com/gogo/protobuf/gogoreplace | ||
|
||
wget -q $(PROTO_ROOT)/common/v1/common.proto -O ./dapr/proto/common/v1/common.proto | ||
gogoreplace 'option go_package = "github.com/dapr/dapr/pkg/proto/common/v1;common";' \ | ||
'option go_package = "github.com/dapr/go-sdk/dapr/proto/common/v1;common";' \ | ||
./dapr/proto/common/v1/common.proto | ||
|
||
wget -q $(PROTO_ROOT)/runtime/v1/appcallback.proto -O ./dapr/proto/runtime/v1/appcallback.proto | ||
gogoreplace 'option go_package = "github.com/dapr/dapr/pkg/proto/runtime/v1;runtime";' \ | ||
'option go_package = "github.com/dapr/go-sdk/dapr/proto/runtime/v1;runtime";' \ | ||
./dapr/proto/runtime/v1/appcallback.proto | ||
|
||
wget -q $(PROTO_ROOT)/runtime/v1/dapr.proto -O ./dapr/proto/runtime/v1/dapr.proto | ||
gogoreplace 'option go_package = "github.com/dapr/dapr/pkg/proto/runtime/v1;runtime";' \ | ||
'option go_package = "github.com/dapr/go-sdk/dapr/proto/runtime/v1;runtime";' \ | ||
./dapr/proto/runtime/v1/dapr.proto | ||
|
||
protoc -I . --go_out=plugins=grpc:. --go_opt=paths=source_relative ./dapr/proto/common/v1/*.proto | ||
protoc -I . --go_out=plugins=grpc:. --go_opt=paths=source_relative ./dapr/proto/runtime/v1/*.proto | ||
|
||
rm -f ./dapr/proto/common/v1/*.proto | ||
rm -f ./dapr/proto/runtime/v1/*.proto | ||
|
||
help: ## Display available commands | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk \ | ||
'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
Oops, something went wrong.