Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
ci: generate ts typings for grpc client stub
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan committed May 12, 2023
1 parent 50226f8 commit 4c15782
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/grpc-client-stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install protoc
run: sudo apt update && sudo apt install -y protobuf-compiler

- uses: actions/setup-node@v3
with:
node-version: 16
Expand All @@ -23,6 +26,10 @@ jobs:
- name: Install grpc-tool globally
run: npm install -g grpc-tools

- name: Install npm packages
working-directory: ./crates/topos-api/proto
run: npm ci

- name: Generate client stubs
working-directory: ./crates/topos-api/proto
run: >
Expand All @@ -38,6 +45,20 @@ jobs:
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/tce/v1/console.proto &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/tce/v1/synchronization.proto
- name: Generate TypeScript typings
working-directory: ./crates/topos-api/proto
run: >
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/shared/v1/certificate.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/shared/v1/checkpoints.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/shared/v1/frost.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/shared/v1/stark_proof.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/shared/v1/subnet.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/shared/v1/uuid.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/uci/v1/certification.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/tce/v1/api.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/tce/v1/console.proto &&
protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./generated topos/tce/v1/synchronization.proto
- name: Publish npm package
working-directory: ./crates/topos-api/proto
run: npm publish --access public
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ terraform.rc

# Subnet integration tests
crates/topos-sequencer-subnet-runtime/tests/temp

# Node modules
**/node_modules
152 changes: 150 additions & 2 deletions crates/topos-api/proto/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions crates/topos-api/proto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@topos-network/topos-grpc-client-stub",
"version": "0.1.0-rc2",
"version": "0.1.0-rc3",
"description": "JavaScript gRPC client stub for topos-api",
"files": [
"generated"
Expand All @@ -22,5 +22,8 @@
"bugs": {
"url": "https://github.com/topos-network/topos/issues"
},
"homepage": "https://github.com/topos-network/topos#readme"
"homepage": "https://github.com/topos-network/topos#readme",
"devDependencies": {
"grpc_tools_node_protoc_ts": "^5.3.3"
}
}

0 comments on commit 4c15782

Please sign in to comment.