jellyfin-sdk-kotlin/.github/workflows/sdk-update-api-spec.yaml
2024-08-26 09:22:14 +02: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-22.04
if: ${{ contains(github.repository_owner, 'jellyfin') }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Java
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.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@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
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 }}'