jellyfin-sdk-kotlin/.github/workflows/sdk-update-api-spec.yaml
2024-10-27 16:17:56 +01:00

47 lines
1.7 KiB
YAML

name: SDK / Update OpenAPI
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
api-spec-update:
name: Update
runs-on: ubuntu-24.04
if: ${{ contains(github.repository_owner, 'jellyfin') }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Java
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
- name: Set STABLE_API_VERSION
run: |
VERSION=$(curl -sL https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-stable.json | jq -r .info.version)
echo "STABLE_API_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Update api spec
run: |
./gradlew :openapi-generator:updateApiSpecStable
./gradlew apiDump
- name: Create pull request
if: always()
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.JF_BOT_TOKEN }}
commit-message: 'Update generated sources to ${{ env.STABLE_API_VERSION }}'
committer: 'jellyfin-bot <team@jellyfin.org>'
author: 'jellyfin-bot <team@jellyfin.org>'
title: 'Update OpenAPI to ${{ env.STABLE_API_VERSION }}'
labels: |
dependencies
openapi
branch: 'openapi-update-'
branch-suffix: 'short-commit-hash'
delete-branch: true
body: 'Update OpenAPI to ${{ env.STABLE_API_VERSION }}'