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..ac6dbe58 --- /dev/null +++ b/.github/workflows/build-and-push-pms-spec.yml @@ -0,0 +1,56 @@ +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/sdk_generation.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: 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 + generate: + needs: build + name: Push to Speakeasy API + uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 # Already pulls the latest spec version + 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 b52cbd77..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 * * * * - push: - branches: - - main - paths: - - .github/workflows/sdk_generation.yaml - - output/plex-media-server-spec-dereferenced.yaml -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 }}