Skip to content

Commit

Permalink
Merge pull request #316 from Abirdcfly/main
Browse files Browse the repository at this point in the history
feat: add auto graphql sdk generator action
  • Loading branch information
bjwswang authored Dec 1, 2023
2 parents 68af1e2 + 64bd42b commit 80f1290
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/graphql_sdk_generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Generate Graphql JS SDK

on:
push:
branches: [main]
paths:
- 'graphql-server/go-server/graph/schema/**'
workflow_dispatch:

jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: make operator image
run: |
make docker-build
- name: Copy the existing kustomize
# avoid kustomize installation to bypass the rate limit of GitHub.
run: |
mkdir -p ${GITHUB_WORKSPACE}/bin
cp /usr/local/bin/kustomize ${GITHUB_WORKSPACE}/bin/kustomize
- name: Install mc
run: |
command -v mc >/dev/null 2>&1 || (curl https://dl.min.io/client/mc/release/linux-amd64/mc \
--create-dirs -o /usr/local/bin/mc && chmod +x /usr/local/bin/mc )
- name: Example test
run: tests/example-test.sh
- name: setting token to npmrc
run: |
echo '//dev-npm.tenxcloud.net/:_authToken="${{ secrets.TENX_NPM_TOKEN }}"' >> ~/.npmrc
echo '//registry.npmjs.org/:_authToken="${{ secrets.NPM_TOKEN }}"' >> ~/.npmrc
- name: make sdk
run: |
kubectl port-forward svc/arcadia-portal-server -n arcadia 8888:8081 --address 0.0.0.0 >/dev/null 2>&1 &
export GRAPH_API_ENDPOINT="http://0.0.0.0:8888/bff"
make gql-sdk-generator
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ run-graphql-server:
POD_NAMESPACE=arcadia go run graphql-server/go-server/main.go --enable-playground=true &

# sdk for graphql-server api
GRL_SDK_GENERATOR_IMAGE ?= kubebb/gql-sdk-generator
GRL_SDK_GENERATOR_IMAGE ?= yuntijs/gql-sdk-generator:latest
GRAPH_API_ENDPOINT ?= http://0.0.0.0:8888/bff
.PHONY: gql-sdk-generator
gql-sdk-generator: run-graphql-server
docker run -v $(shell pwd)/graphql-server/go-server/graph/schema:/schema ${GRL_SDK_GENERATOR_IMAGE}:main

gql-sdk-generator:
docker run --rm --net=host --env SDK_PACKAGE_NAME=@yuntijs/arcadia-bff-sdk --env SDK_YUNTI_NAME=ArcadiaBffSDK --env GRAPH_API_ENDPOINT=${GRAPH_API_ENDPOINT} -v $(shell pwd)/graphql-server/go-server/graph/schema:/schema -v ~/.npmrc:/root/.npmrc ${GRL_SDK_GENERATOR_IMAGE}

# prepare for git push
.PHONY: prepare-push
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/arcadia/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: arcadia
description: A Helm chart(KubeBB Component) for KubeAGI Arcadia
type: application
version: 0.1.33
version: 0.1.34
appVersion: "0.0.1"

keywords:
Expand Down

0 comments on commit 80f1290

Please sign in to comment.