Skip to content

Commit

Permalink
Merge pull request #44 from LukeHagar/project-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLandbridge authored Aug 30, 2024
2 parents 89547c8 + e6763a8 commit 6a39c5d
Show file tree
Hide file tree
Showing 94 changed files with 45 additions and 10,507 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/build-and-copy-pms-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ on:
branches:
- main
paths:
- "pms-spec.yaml"
- "parameters/**"
- "responses/**"
- "paths/**"

- src/**

workflow_dispatch:

jobs:
Expand All @@ -18,28 +15,35 @@ 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"
skip_checkout: true
skip_fetch: true
add_options: '-f'
file_pattern: './output/*.yaml'
skip_dirty_check: true

- 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: [email protected]
user_name: lukehagar
commit_message: Updating PMS Spec

- uses: stefanzweifel/git-auto-commit-action@v4
17 changes: 12 additions & 5 deletions .github/workflows/openapi-linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions .github/workflows/sdk_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
output
.idea
.spectral.mjs
.vscode
.stoplight
.stoplight.json
node_modules
.idea
output
2 changes: 1 addition & 1 deletion .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
2 changes: 1 addition & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
17 changes: 0 additions & 17 deletions .stoplight.json

This file was deleted.

15 changes: 0 additions & 15 deletions .stoplight/styleguide.json

This file was deleted.

4 changes: 0 additions & 4 deletions .vscode/settings.json

This file was deleted.

File renamed without changes.
8 changes: 4 additions & 4 deletions tests/package.json → package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"description": "",
"main": "index.js",
"scripts": {
"bundle": "swagger-cli bundle --dereference ../pms-spec.yaml -t yaml -o ../plex-media-server-spec-dereferenced.yaml",
"test": "bun run bundle && vitest --run",
"build": "swagger-cli bundle --dereference ./src/pms-spec.yaml -t yaml -o ./output/plex-media-server-spec-dereferenced.yaml",
"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 ../pms-spec.yaml",
"lint-bundled": "bun run bundle && speakeasy lint openapi -s ../plex-media-server-spec-dereferenced.yaml"
"lint": "speakeasy lint openapi -s ./src/pms-spec.yaml",
"lint-bundled": "bun run build && speakeasy lint openapi -s ./output/plex-media-server-spec-dereferenced.yaml"
},
"keywords": [],
"author": "",
Expand Down
Loading

0 comments on commit 6a39c5d

Please sign in to comment.