Fixed pathing

This commit is contained in:
JasonLandbridge
2024-08-30 10:33:45 +02:00
parent fedb69d6d3
commit e85c8db284
7 changed files with 33 additions and 30 deletions

View File

@@ -5,10 +5,7 @@ on:
branches:
- main
paths:
- "pms-spec.yaml"
- "parameters/**"
- "responses/**"
- "paths/**"
- src/**
workflow_dispatch:
@@ -18,28 +15,30 @@ jobs:
steps:
- name: Checkout PR branch
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Install swagger-cli
run: |
npm install -g swagger-cli
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: bun install
- name: Dereference Plex Media Server Specification
run: |
swagger-cli bundle --dereference pms-spec.yaml -t yaml -o plex-media-server-spec-dereferenced.yaml
run: bun run build
- name: Commit Dereferenced Specification File
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "build: dereferenced Plex Media Server API Spec updated"
- name: Pushes Dereferenced Specification File
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: plex-media-server-spec-dereferenced.yaml
source_file: ./output/plex-media-server-spec-dereferenced.yaml
destination_repo: lukehagar/plex-docs
destination_folder: static
user_email: lukeslakemail@gmail.com
user_name: lukehagar
commit_message: Updating PMS Spec
- uses: stefanzweifel/git-auto-commit-action@v4

View File

@@ -2,16 +2,23 @@ name: Linting
"on":
pull_request:
paths:
- pms-spec.yaml
- src/**
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout PR branch
uses: actions/checkout@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: bun install
- name: Install Speakeasy CLI
run: |
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
run: bun run setup-speakeasy-cli
- name: OpenAPI Lint
run: speakeasy lint openapi -s pms-spec.yaml
run: bun run lint

View File

@@ -17,11 +17,8 @@ permissions:
branches:
- main
paths:
- pms-spec.yaml
- .github/workflows/sdk_generation.yaml
- paths/**
- parameters/**
- responses/**
- src/**
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15

View File

@@ -14,7 +14,7 @@ workflow:
sources:
Plex-API:
inputs:
- location: pms-spec.yaml
- location: ./src/pms-spec.yaml
registry:
location: registry.speakeasyapi.dev/lukehagar/lukehagar/plex-api
targets: {}

View File

@@ -3,7 +3,7 @@ speakeasyVersion: latest
sources:
Plex-API:
inputs:
- location: pms-spec.yaml
- location: ./src/pms-spec.yaml
registry:
location: registry.speakeasyapi.dev/lukehagar/lukehagar/plex-api
targets: {}

View File

@@ -5,10 +5,10 @@
"main": "index.js",
"scripts": {
"build": "swagger-cli bundle --dereference ./src/pms-spec.yaml -t yaml -o ./output/plex-media-server-spec-dereferenced.yaml",
"test": "bun run bundle && vitest --run",
"test": "bun run build && vitest --run",
"setup-speakeasy-cli": "curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh",
"lint": "speakeasy lint openapi -s ./src/pms-spec.yaml",
"lint-bundled": "bun run bundle && speakeasy lint openapi -s ./output/plex-media-server-spec-dereferenced.yaml"
"lint-bundled": "bun run build && speakeasy lint openapi -s ./output/plex-media-server-spec-dereferenced.yaml"
},
"keywords": [],
"author": "",

View File

@@ -1,4 +1,4 @@
import PMSSpec from '../plex-media-server-spec-dereferenced.yaml'
import PMSSpec from '../../output/plex-media-server-spec-dereferenced.yaml';
import Ajv from "ajv";
import addFormats from "ajv-formats";
import {expect} from 'vitest'