From 1cbf1c86846ec9239904bdb44a1fe06be6b72e6f Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 23 Feb 2024 16:08:00 -0500 Subject: [PATCH 1/2] Add GH action to update sdk dependency --- .github/workflows/update-sdk.yml | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/update-sdk.yml diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml new file mode 100644 index 0000000000..a2b9ed20f7 --- /dev/null +++ b/.github/workflows/update-sdk.yml @@ -0,0 +1,51 @@ +name: Update the Jellyfin SDK + +on: + schedule: + - cron: '0 7 * * *' + workflow_dispatch: + +concurrency: + group: unstable-sdk-pr + cancel-in-progress: true + +jobs: + update: + runs-on: ubuntu-latest + if: ${{ github.repository == 'jellyfin/jellyfin-web' }} + + steps: + - name: Check out Git repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: master + token: ${{ secrets.JF_BOT_TOKEN }} + + - name: Set up Node.js + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: 20 + check-latest: true + cache: npm + + - name: Install latest unstable SDK + run: | + npm i --save @jellyfin/sdk@unstable + git checkout package.json + + - name: Open a pull request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.JF_BOT_TOKEN }} + commit-message: Update @jellyfin/sdk + committer: jellyfin-bot + author: jellyfin-bot + branch: update-jf-sdk + delete-branch: true + title: Update @jellyfin/sdk + body: | + **Changes** + Updates to the latest unstable @jellyfin/sdk build + labels: | + dependencies + npm From 36a9d237a97ef72acc99c1c0163f58e3a82b9b7e Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 23 Feb 2024 16:31:11 -0500 Subject: [PATCH 2/2] Add sdk version to commit message and pr title --- .github/workflows/update-sdk.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml index a2b9ed20f7..a6cbff71ef 100644 --- a/.github/workflows/update-sdk.yml +++ b/.github/workflows/update-sdk.yml @@ -31,18 +31,20 @@ jobs: - name: Install latest unstable SDK run: | npm i --save @jellyfin/sdk@unstable + VERSION=$(jq -r '.dependencies["@jellyfin/sdk"]' package.json) + echo "JF_SDK_VERSION=${VERSION}" >> $GITHUB_ENV git checkout package.json - name: Open a pull request uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.JF_BOT_TOKEN }} - commit-message: Update @jellyfin/sdk + commit-message: Update @jellyfin/sdk to ${{env.JF_SDK_VERSION}} committer: jellyfin-bot author: jellyfin-bot branch: update-jf-sdk delete-branch: true - title: Update @jellyfin/sdk + title: Update @jellyfin/sdk to ${{env.JF_SDK_VERSION}} body: | **Changes** Updates to the latest unstable @jellyfin/sdk build