diff --git a/.github/workflows/build-and-copy-pms-spec.yml b/.github/workflows/build-and-copy-pms-spec.yml deleted file mode 100644 index 8df7cd5e..00000000 --- a/.github/workflows/build-and-copy-pms-spec.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build and Copy Dereferenced Plex Media Server API Spec - -on: - push: - branches: - - main - paths: - - src/** - - workflow_dispatch: - -jobs: - dereference_api: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Project Setup - uses: ./.github/workflows/steps/project-setup - - - name: Dereference Plex Media Server Specification - 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 \ No newline at end of file diff --git a/.github/workflows/build-and-push-pms-spec.yml b/.github/workflows/build-and-push-pms-spec.yml new file mode 100644 index 00000000..e61f94f6 --- /dev/null +++ b/.github/workflows/build-and-push-pms-spec.yml @@ -0,0 +1,55 @@ +name: Build and Push Plex Media Server API Spec + +permissions: + checks: write + contents: write + pull-requests: write + statuses: write + +on: + workflow_dispatch: + inputs: + force: + description: Force generation of SDKs + type: boolean + default: false + push: + branches: + - main + paths: + - .github/workflows/build-and-push-pms-spec.yaml + - src/** + +jobs: + build: + name: Build Open API Spec + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Project Setup + uses: ./.github/workflows/steps/project-setup + + - name: Build Plex Media Server Specification + run: bun run build + + - name: Commit Build Specification Files + 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 + generate: + needs: build + name: Push to Speakeasy API + uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 + with: + force: ${{ github.event.inputs.force }} + mode: direct + speakeasy_version: latest + secrets: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} diff --git a/.github/workflows/sdk_generation.yaml b/.github/workflows/sdk_generation.yaml deleted file mode 100644 index d4f3bf3f..00000000 --- a/.github/workflows/sdk_generation.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Generate -permissions: - checks: write - contents: write - pull-requests: write - statuses: write -"on": - workflow_dispatch: - inputs: - force: - description: Force generation of SDKs - type: boolean - default: false - schedule: - - cron: 0 0 * * * - push: - branches: - - main - paths: - - .github/workflows/sdk_generation.yaml - - output/** -jobs: - generate: - uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 - with: - force: ${{ github.event.inputs.force }} - mode: direct - speakeasy_version: latest - secrets: - github_access_token: ${{ secrets.GITHUB_TOKEN }} - speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} diff --git a/bun.lockb b/bun.lockb index eb247b80..b5e6d77b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 3833d58f..aaee5661 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,10 @@ "dev": "redocly preview -d=./src", "preview-docs": "redocly preview-docs src/pms-spec.yaml --config=./redocly.yaml", "stats": "redocly stats ./src/pms-spec.yaml", - "build": "swagger-cli bundle --dereference ./src/pms-spec.yaml -t yaml -o ./output/plex-media-server-spec-dereferenced.yaml", + "build": "bun run build-referenced & bun run build-dereferenced & wait", + "build-referenced": "redocly bundle ./src/pms-spec.yaml --ext yaml -o ./output/plex-media-server-spec-referenced.yaml", + "build-dereferenced": "swagger-cli bundle --dereference ./src/pms-spec.yaml -t yaml -o ./output/plex-media-server-spec-dereferenced.yaml", "build-watch": "bun run build && chokidar './src/**/*' -c 'bun run build'", - "build-redocly": "redocly bundle ./src/pms-spec.yaml --ext yaml -o ./output/plex-media-server-spec-dereferenced.yaml", "test": "bun run build && vitest --run", "type-check": "tsc", "setup-speakeasy-cli": "curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh", @@ -30,7 +31,7 @@ }, "devDependencies": { "@modyfi/vite-plugin-yaml": "^1.1.0", - "@redocly/cli": "^1.23.1", + "@redocly/cli": "^1.25.4", "@types/lodash-es": "^4.17.12", "@types/node": "^22.5.0", "chokidar-cli": "^3.0.0",