Create sdk-unstable-branch.yaml (#24)

This commit is contained in:
Ethan Pippin 2023-10-16 12:57:14 -06:00 committed by GitHub
parent ecc338b4ac
commit c277dace7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,46 @@
name: Generate Unstable Branch
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
push:
branches:
- master
concurrency:
group: unstable-branch
jobs:
build:
runs-on: macos-latest
if: ${{ github.repository == 'jellyfin/jellyfin-sdk-swift' }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.JF_BOT_TOKEN }}
- name: Download unstable OpenAPI schema
run: |
curl -sL https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-unstable.json -o jellyfin-openapi-stable.json
cp -rf jellyfin-openapi-stable.json $GITHUB_WORKSPACE/Sources
- name: Generate API
run: |
cd $GITHUB_WORKSPACE
swift package --allow-writing-to-package-directory generate-api
- name: Build
run: |
swift build
- name: Commit changes
run: |
git config user.name jellyfin-bot
git config user.email team@jellyfin.org
git checkout -B openapi-unstable
git add .
git commit --allow-empty -m "Update OpenAPI to unstable"
git push --force origin openapi-unstable