-
-
Notifications
You must be signed in to change notification settings - Fork 27
65 lines (54 loc) · 1.88 KB
/
sdk-unstable-branch.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 [email protected]
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