From 6cccdf82477b77b085795c8e971ae842d23918cb Mon Sep 17 00:00:00 2001 From: Jakob Warkotsch Date: Tue, 22 Oct 2024 17:48:09 +0200 Subject: [PATCH] REST API client github action --- .github/workflows/publishRestApiClient.yml | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/publishRestApiClient.yml diff --git a/.github/workflows/publishRestApiClient.yml b/.github/workflows/publishRestApiClient.yml new file mode 100644 index 0000000000..7126da0581 --- /dev/null +++ b/.github/workflows/publishRestApiClient.yml @@ -0,0 +1,27 @@ +name: Publish REST API Client +on: + push: + branches: [ master ] +jobs: + build-and-publish-api-client: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '20.x' + - name: Dereference OpenAPI doc + run: npx json-dereference-cli json-dereference -s repo/rest-api/src/RouteHandlers/openapi.json -o openapi-dereferenced.json + - name: Build the API client + uses: addnab/docker-run-action@v3 + with: + image: openapitools/openapi-generator-cli + options: -v ${{ github.workspace }}:/local -w /local + run: | + /usr/local/bin/docker-entrypoint.sh generate \ + -i openapi-dereferenced.json \ + -g javascript \ + -o api-client \ + --additional-properties=usePromises=true + - name: test + run: echo "$(ls -l api-client/)"