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

Commit

Permalink
ci: add new grpc js client stubs generation CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan committed May 11, 2023
1 parent cc10168 commit 17d4450
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/grpc-client-stubs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: JS gRPC client stubs generation

on:
release:
types: [published]

jobs:
js-grpc:
name: JS gRPC client stubs generation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: ./crates/topos-api/proto/package-lock.json
registry-url: https://registry.npmjs.org
scope: "@topos-network"

- name: Install grpc-tool globally
run: npm install -g grpc-tools

- name: Generate client stubs
working-directory: ./crates/topos-api/proto
run: >
mkdir generated &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/shared/v1/certificate.proto &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/shared/v1/checkpoints.proto &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/shared/v1/frost.proto &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/shared/v1/stark_proof.proto &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/shared/v1/subnet.proto &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/shared/v1/uuid.proto &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/uci/v1/certification.proto &&
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./generated --grpc_out=grpc_js:./generated topos/tce/v1/api.proto &&
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: Publish npm package
working-directory: ./crates/topos-api/proto
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,3 @@ jobs:
- run: cargo nextest run cert_delivery --locked --no-default-features -F tce
env:
RUST_LOG: topos=info


13 changes: 13 additions & 0 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.

26 changes: 26 additions & 0 deletions crates/topos-api/proto/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@topos-network/topos-grpc-client-stub",
"version": "0.1.0-rc2",
"description": "JavaScript gRPC client stub for topos-api",
"files": [
"generated"
],
"repository": {
"type": "git",
"url": "git+https://github.com/topos-network/topos.git"
},
"keywords": [
"grpc",
"api",
"topos",
"client",
"stub",
"javascript"
],
"author": "Sebastien Dan <sebastien.dan@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/topos-network/topos/issues"
},
"homepage": "https://github.com/topos-network/topos#readme"
}

0 comments on commit 17d4450

Please sign in to comment.