Skip to content

Merge pull request #834 from jellyfin/renovate/rollup-4.x #1174

Merge pull request #834 from jellyfin/renovate/rollup-4.x

Merge pull request #834 from jellyfin/renovate/rollup-4.x #1174

name: SDK Unstable Branch
on:
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
push:
branches:
- master
concurrency:
group: unstable-branch
jobs:
update:
runs-on: ubuntu-latest
if: ${{ github.repository == 'jellyfin/jellyfin-sdk-typescript' }}
steps:
- name: Check out Git repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: openapi-unstable
fetch-depth: 0
token: ${{ secrets.JF_BOT_TOKEN }}
- name: Update unstable branch from master
run: |
git config user.name jellyfin-bot
git config user.email team@jellyfin.org
git rebase --strategy-option theirs origin/master
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20
check-latest: true
cache: npm
- name: Install Node.js dependencies
run: npm ci --no-audit
- name: Download unstable OpenAPI schema
run: |
curl -sL https://api.jellyfin.org/openapi/jellyfin-openapi-unstable.json -o openapi.json
npm run fix-schema
cp openapi.json $HOME
- name: Set UNSTABLE_API_VERSION
run: |
VERSION=$(jq -r .info.version openapi.json)
echo "UNSTABLE_API_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Update generated sources
run: |
cp $HOME/openapi.json .
npm run build:generated-client
sed -i "s/API_VERSION = '.*'/API_VERSION = '${{ env.UNSTABLE_API_VERSION }}'/" src/versions.ts
- name: Commit changes
continue-on-error: true
run: |
[[ -n $(git status --porcelain) ]] && git add --all && git commit --amend -m "Update OpenAPI to unstable"
- name: Push changes
run: git push --force origin openapi-unstable