Skip to content

Commit

Permalink
Add auto sdk gen + release upload action (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmthecoder committed Aug 29, 2024
1 parent ccb0140 commit d5b39bd
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/create-sdk-on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Upload SDK for Release

jobs:
build:
name: Upload SDK for Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v4
- name: Install Yarn
run: npm install -g yarn
- name: Install Dependencies
run: yarn install
- name: Generate SDK
run: yarn gen-client-sdk
- name: Create Tarball
run: tar -czf juno-client-sdk.tar.gz juno-client-sdk
- name: Release with Notes
uses: softprops/action-gh-release@v1
with:
files: |
juno-client-sdk.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ lerna-debug.log*
.env
.env.local
.bitwarden.env
juno-client-sdk/
7 changes: 7 additions & 0 deletions openapitools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.8.0"
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"lint": "nx run-many --target=lint --no-cloud",
"sync-protos": "node syncJunoProtos.js",
"gen-proto": "yarn workspace juno-proto install && yarn workspace juno-proto build && yarn sync-protos",
"gen-client-sdk": "yarn openapi-generator-cli generate -g typescript-node -i ./packages/api-gateway/sdk.yaml -o ./juno-client-sdk",
"preinstall": "yarn gen-proto",
"test:e2e:api-gateway-live": "GATEWAY_COMMAND=test:e2e:watch RUN_MODE=test yarn start:dev:live-all --exit-code-from api-gateway",
"test:e2e:auth-service-live": "AUTH_COMMAND=test:e2e:watch RUN_MODE=test yarn start:dev:live-all --exit-code-from auth-service auth-service",
Expand All @@ -34,6 +35,7 @@
"test:e2e:logging-service": "LOGGING_COMMAND=test:e2e RUN_MODE=test yarn start:dev --exit-code-from logging-service logging-service"
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "^2.13.5",
"concurrently": "^8.2.2",
"nx": "^17.0.0",
"prettier": "^3.0.3",
Expand Down
5 changes: 4 additions & 1 deletion packages/api-gateway/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ lerna-debug.log*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/extensions.json

sdk/
sdk*
53 changes: 53 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,11 @@
resolved "https://registry.yarnpkg.com/@nestjs/axios/-/axios-3.0.1.tgz#b006f81dd54a49def92cfaf9a8970434567e75ce"
integrity sha512-VlOZhAGDmOoFdsmewn8AyClAdGpKXQQaY1+3PGB+g6ceurGIdTxZgRX3VXc1T6Zs60PedWjg3A82TDOB05mrzQ==

"@nestjs/[email protected]":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@nestjs/axios/-/axios-3.0.2.tgz#0078c101a29fb46f5c566d68a4315fddabc083ed"
integrity sha512-Z6GuOUdNQjP7FX+OuV2Ybyamse+/e0BFdTWBX5JxpBDKA+YkdLynDgG6HTF04zy6e9zPa19UX0WA2VDoehwhXQ==

"@nestjs/cli@^10.0.0":
version "10.3.2"
resolved "https://registry.yarnpkg.com/@nestjs/cli/-/cli-10.3.2.tgz#42d2764ead6633e278c55d42de871b4cc1db002b"
Expand Down Expand Up @@ -981,6 +986,30 @@
rxjs "7.8.1"
tslib "2.6.2"

"@openapitools/openapi-generator-cli@^2.13.5":
version "2.13.5"
resolved "https://registry.yarnpkg.com/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.13.5.tgz#6fc835e18bce9c84be268264fcfa37456ef46025"
integrity sha512-9VgeKOTiiatKSwZDKKB3C86cW8tN9eDcFohotD4eisdK38UQswk/4Ysoq9KChRCbymjoMp6AIDHPtK1DQ2fTgw==
dependencies:
"@nestjs/axios" "3.0.2"
"@nestjs/common" "10.3.0"
"@nestjs/core" "10.3.0"
"@nuxtjs/opencollective" "0.3.2"
axios "1.7.4"
chalk "4.1.2"
commander "8.3.0"
compare-versions "4.1.4"
concurrently "6.5.1"
console.table "0.10.0"
fs-extra "10.1.0"
glob "7.2.3"
https-proxy-agent "7.0.4"
inquirer "8.2.6"
lodash "4.17.21"
reflect-metadata "0.1.13"
rxjs "7.8.1"
tslib "2.6.2"

"@pkgjs/parseargs@^0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
Expand Down Expand Up @@ -1673,6 +1702,13 @@ agent-base@6:
dependencies:
debug "4"

agent-base@^7.0.2:
version "7.1.1"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.1.tgz#bdbded7dfb096b751a2a087eeeb9664725b2e317"
integrity sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==
dependencies:
debug "^4.3.4"

[email protected]:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520"
Expand Down Expand Up @@ -1828,6 +1864,15 @@ [email protected]:
form-data "^4.0.0"
proxy-from-env "^1.1.0"

[email protected]:
version "1.7.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.4.tgz#4c8ded1b43683c8dd362973c393f3ede24052aa2"
integrity sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==
dependencies:
follow-redirects "^1.15.6"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axios@^1.6.0, axios@^1.6.4, axios@^1.6.7:
version "1.6.8"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66"
Expand Down Expand Up @@ -3349,6 +3394,14 @@ [email protected]:
statuses "2.0.1"
toidentifier "1.0.1"

[email protected]:
version "7.0.4"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz#8e97b841a029ad8ddc8731f26595bad868cb4168"
integrity sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==
dependencies:
agent-base "^7.0.2"
debug "4"

https-proxy-agent@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6"
Expand Down

0 comments on commit d5b39bd

Please sign in to comment.