Skip to content

SDK Unstable Branch #1073

SDK Unstable Branch

SDK Unstable Branch #1073

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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
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 [email protected]
git rebase --strategy-option theirs origin/master
- name: Set up Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
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