diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..76f49c8 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,18 @@ +name: Build +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + check-latest: true + - name: Install Protoc + uses: arduino/setup-protoc@v2 + - name: Validate and build go bindings from the proto files + run: make ci-build + env: + BUF_INPUT_HTTPS_USERNAME: ${{github.actor}} + BUF_INPUT_HTTPS_PASSWORD: ${{github.token}} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5a9d090 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2023 Temporal Technologies Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Makefile b/Makefile index 3eec3b7..cf901cd 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ $(VERBOSE).SILENT: ci-build: install proto # Install dependencies. -install: buf-install openapiv2-install +install: buf-install grpc-install openapiv2-install # Run all linters and compile proto files. proto: grpc @@ -24,7 +24,7 @@ $(PROTO_OUT): mkdir $(PROTO_OUT) ##### Compile proto files for go ##### -grpc: buf-lint go-grpc +grpc: buf-lint buf-breaking go-grpc go-grpc: clean $(PROTO_OUT) printf $(COLOR) "Compile for go-gRPC..." @@ -35,8 +35,13 @@ buf-install: printf $(COLOR) "Install/update buf..." go install github.com/bufbuild/buf/cmd/buf@v1.25.1 +grpc-install: + printf $(COLOR) "Install/update go and grpc protoc gen ..." + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3 + openapiv2-install: - printf $(COLOR) "Install/update ..." + printf $(COLOR) "Install/update openapiv2 protoc gen..." go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.16.2 ##### Linters ##### @@ -45,8 +50,8 @@ buf-lint: buf lint buf-breaking: - @printf $(COLOR) "Run buf breaking changes check against master branch..." - buf breaking --against '.git#branch=main' + @printf $(COLOR) "Run buf breaking changes check against main branch..." + buf breaking --against 'https://github.com/temporalio/api-cloud.git#branch=main' ##### Clean ##### clean: diff --git a/README.md b/README.md new file mode 100644 index 0000000..e5233ef --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# Temporal cloud api proto files + +## How to use + +Copy over the protobuf files under [temporal](temporal) directory to the project directory and then use [grpc](https://grpc.io/docs/) to compile and generate code in the desired programming language. + +## URL + +The grpc URL the clients should connect to: +``` +saas-api.tmprl.cloud:443 +``` + +## Samples + +Refer [cloud-samples-go](https://github.com/temporalio/cloud-samples-go) repository for demonstration on how a project can copy and build Go clients.