-
-
Notifications
You must be signed in to change notification settings - Fork 27
59 lines (49 loc) · 1.91 KB
/
sdk-update-api-spec.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
name: SDK Update API from Spec
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
api-spec-update:
runs-on: ubuntu-latest
if: ${{ github.repository == 'jellyfin/jellyfin-sdk-typescript' }}
steps:
- name: Check out Git repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 16
check-latest: true
cache: npm
- name: Download stable OpenAPI schema
run: |
curl -sL https://repo.jellyfin.org/releases/openapi/jellyfin-openapi-stable.json -o openapi.json
npm run fix-schema
cp openapi.json $HOME
- name: Set STABLE_API_VERSION
run: |
VERSION=$(jq -r .info.version openapi.json)
echo "STABLE_API_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Install Node.js dependencies
run: npm ci --no-audit
- name: Update generated sources and create pull request
uses: technote-space/create-pr-action@91114507cf92349bec0a9a501c2edf1635427bc5 # v2
with:
EXECUTE_COMMANDS: |
cp $HOME/openapi.json .
npm run build:generated-client
sed -i "s/API_VERSION = '.*'/API_VERSION = '${{ env.STABLE_API_VERSION }}'/" src/versions.ts
COMMIT_MESSAGE: 'Update generated sources to ${{ env.STABLE_API_VERSION }}'
COMMIT_NAME: 'jellyfin-bot'
COMMIT_EMAIL: '[email protected]'
PR_BRANCH_PREFIX: 'openapi-update-'
PR_BRANCH_NAME: '${PR_ID}'
PR_TITLE: 'Update OpenAPI to ${{ env.STABLE_API_VERSION }}'
PR_BODY: |
## Changed files
<details>
<summary>${FILES_SUMMARY}</summary>
${FILES}
</details>
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }}