Skip to content

Commit 9384ac4

Browse files
authored
Merge pull request #351 from thornbill/unstable-branch-ci
Add ci to update openapi-unstable branch
2 parents 3d1ec82 + 7be1a7a commit 9384ac4

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: SDK / Unstable branch
2+
3+
on:
4+
schedule:
5+
- cron: '0 5 * * *'
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: unstable-branch
13+
14+
jobs:
15+
update:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.repository == 'jellyfin/jellyfin-sdk-typescript' }}
18+
steps:
19+
- name: Check out Git repository
20+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
21+
with:
22+
ref: master
23+
token: ${{ secrets.JF_BOT_TOKEN }}
24+
25+
- name: Set up Node.js
26+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
27+
with:
28+
node-version: 16
29+
check-latest: true
30+
cache: npm
31+
32+
- name: Download unstable OpenAPI schema
33+
run: |
34+
curl -sL https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-unstable.json -o openapi.json
35+
npm run fix-schema
36+
cp openapi.json $HOME
37+
38+
- name: Set UNSTABLE_API_VERSION
39+
run: |
40+
VERSION=$(jq -r .info.version openapi.json)
41+
echo "UNSTABLE_API_VERSION=${VERSION}" >> $GITHUB_ENV
42+
43+
- name: Install Node.js dependencies
44+
run: npm ci --no-audit
45+
46+
- name: Update generated sources
47+
run: |
48+
cp $HOME/openapi.json .
49+
npm run build:generated-client
50+
sed -i "s/API_VERSION = '.*'/API_VERSION = '${{ env.UNSTABLE_API_VERSION }}'/" src/jellyfin.ts
51+
52+
- name: Commit changes
53+
run: |
54+
git config user.name jellyfin-bot
55+
git config user.email [email protected]
56+
git checkout -B openapi-unstable
57+
git add .
58+
git commit --allow-empty -m "Update OpenAPI to unstable"
59+
git push --force origin openapi-unstable

0 commit comments

Comments
 (0)