Skip to content

Testing a unified spec and sdk #6

Testing a unified spec and sdk

Testing a unified spec and sdk #6

Workflow file for this run

name: "Validate TypeScript SDK Build"
on:
pull_request:
branches:
- main
paths:
- plextv/**
- pms/**
workflow_dispatch:
jobs:
push_spec_workflow:
name: Build and test typescript SDK
runs-on: ubuntu-latest
steps:
# Checkout the master branch request to run rsync
- name: Checkout PR branch
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
# Checkout the main branch of api-specs
- name: Checkout API Specs Repo
uses: actions/checkout@v3
with:
repository: LukeHagar/plexjs
path: sdk-ts
ref: main
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Build PMS
id: buildPMS
run: |
cd sdk-ts
rm -rf plexjs/pms
java -jar openapi-generator-cli.jar generate -i ../pms/pms-spec.yaml -g typescript-axios -o plexjs/pms --global-property skipFormModel=false --config sdk-resources/pms-config.yaml
- name: Build TS SDK
id: buildPTV
if: steps.buildPMS.outcome == 'success'
run: |
cd sdk-ts
rm -rf plexjs/plextv
java -jar openapi-generator-cli.jar generate -i ../plextv/plextv-spec.yaml -g typescript-axios -o plexjs/plextv --global-property skipFormModel=false --config sdk-resources/plextv-config.yaml
- name: After SDK Build
uses: actions/upload-artifact@v3
with:
name: PR-Build-${{ github.ref }}
path: sdk-ts
- name: Run npm install and build Typescript SDK
id: buildSDK
if: steps.buildPTV.outcome == 'success'
run: |
cd sdk-ts/plexjs
npm install
npm run build