ci: format github yml files

This commit is contained in:
Kilian von Pflugk 2024-10-06 19:03:15 +02:00
parent 45afbed8b0
commit 27af7f29f4
6 changed files with 167 additions and 169 deletions

View File

@ -8,10 +8,10 @@ body:
attributes: attributes:
label: Self service debugging label: Self service debugging
description: | description: |
Jellyfin 10.9 is actively updated. Please make sure you are using the [latest](https://github.com/jellyfin/jellyfin/releases/latest) release. Jellyfin 10.9 is actively updated. Please make sure you are using the [latest](https://github.com/jellyfin/jellyfin/releases/latest) release.
Many servers have permission issues that can be resolved with a few extra steps. Many servers have permission issues that can be resolved with a few extra steps.
If your skip button is not shown, please see [Troubleshooting](https://github.com/intro-skipper/intro-skipper/wiki/Troubleshooting#skip-button-is-not-visible) before reporting. If your skip button is not shown, please see [Troubleshooting](https://github.com/intro-skipper/intro-skipper/wiki/Troubleshooting#skip-button-is-not-visible) before reporting.
options: options:
- label: I use Jellyfin 10.9.11 (or newer) and my permissions are correct - label: I use Jellyfin 10.9.11 (or newer) and my permissions are correct
required: true required: true
@ -74,4 +74,3 @@ body:
label: Jellyfin logs label: Jellyfin logs
placeholder: Paste any relevant logs here placeholder: Paste any relevant logs here
render: shell render: shell

View File

@ -18,7 +18,7 @@ updates:
- package-ecosystem: github-actions - package-ecosystem: github-actions
directory: / directory: /
schedule: schedule:
interval: monthly interval: weekly
open-pull-requests-limit: 10 open-pull-requests-limit: 10
labels: labels:
- ci - ci

View File

@ -1,22 +1,22 @@
name: 'Build Plugin' name: "Build Plugin"
on: on:
push: push:
branches: [ "master" ] branches: ["master"]
paths-ignore: paths-ignore:
- '**/README.md' - "**/README.md"
- '.github/ISSUE_TEMPLATE/**' - ".github/ISSUE_TEMPLATE/**"
- 'docs/**' - "docs/**"
- 'images/**' - "images/**"
- 'manifest.json' - "manifest.json"
pull_request: pull_request:
branches: [ "master" ] branches: ["master"]
paths-ignore: paths-ignore:
- '**/README.md' - "**/README.md"
- '.github/ISSUE_TEMPLATE/**' - ".github/ISSUE_TEMPLATE/**"
- 'docs/**' - "docs/**"
- 'images/**' - "images/**"
- 'manifest.json' - "manifest.json"
permissions: permissions:
contents: write contents: write
@ -29,76 +29,76 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Sanitize head_ref - name: Sanitize head_ref
run: | run: |
# Get the branch name and sanitize it # Get the branch name and sanitize it
SANITIZED_BRANCH_NAME=$(echo "${{ github.head_ref }}" | sed 's/[^a-zA-Z0-9.-]/_/g') SANITIZED_BRANCH_NAME=$(echo "${{ github.head_ref }}" | sed 's/[^a-zA-Z0-9.-]/_/g')
# Export it as an environment variable
echo "SANITIZED_BRANCH_NAME=$SANITIZED_BRANCH_NAME" >> $GITHUB_ENV
- uses: actions/checkout@v4 # Export it as an environment variable
echo "SANITIZED_BRANCH_NAME=$SANITIZED_BRANCH_NAME" >> $GITHUB_ENV
- name: Setup .NET - uses: actions/checkout@v4
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup Node.js - name: Setup .NET
uses: actions/setup-node@v4 uses: actions/setup-dotnet@v4
with: with:
node-version: 'lts/*' dotnet-version: 8.0.x
- name: Install html-minifier-terser - name: Setup Node.js
run: npm install terser html-minifier-terser uses: actions/setup-node@v4
with:
- name: Minify HTML node-version: "lts/*"
run: |
- name: Install html-minifier-terser
run: npm install terser html-minifier-terser
- name: Minify HTML
run: |
npx html-minifier-terser --collapse-boolean-attributes --collapse-whitespace --collapse-inline-tag-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html npx html-minifier-terser --collapse-boolean-attributes --collapse-whitespace --collapse-inline-tag-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html
npx terser ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js -c -m npx terser ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js -c -m
npx terser ConfusedPolarBear.Plugin.IntroSkipper/Configuration/visualizer.js -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/visualizer.js -c -m npx terser ConfusedPolarBear.Plugin.IntroSkipper/Configuration/visualizer.js -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/visualizer.js -c -m
- name: Restore dependencies - name: Restore dependencies
run: dotnet restore run: dotnet restore
- name: Embed version info - name: Embed version info
run: | run: |
GITHUB_SHA=${{ github.sha }} GITHUB_SHA=${{ github.sha }}
sed -i "s/string\.Empty/\"$GITHUB_SHA\"/g" ConfusedPolarBear.Plugin.IntroSkipper/Helper/Commit.cs sed -i "s/string\.Empty/\"$GITHUB_SHA\"/g" ConfusedPolarBear.Plugin.IntroSkipper/Helper/Commit.cs
- name: Retrieve commit identification - name: Retrieve commit identification
run: | run: |
GIT_HASH=$(git rev-parse --short HEAD) GIT_HASH=$(git rev-parse --short HEAD)
echo "GIT_HASH=${GIT_HASH}" >> $GITHUB_ENV echo "GIT_HASH=${GIT_HASH}" >> $GITHUB_ENV
- name: Build - name: Build
run: dotnet build --no-restore run: dotnet build --no-restore
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4.3.6 uses: actions/upload-artifact@v4.3.6
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
with: with:
name: ConfusedPolarBear.Plugin.IntroSkipper-${{ env.GIT_HASH }}.dll name: ConfusedPolarBear.Plugin.IntroSkipper-${{ env.GIT_HASH }}.dll
path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
if-no-files-found: error if-no-files-found: error
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4.3.6 uses: actions/upload-artifact@v4.3.6
if: github.event_name == 'pull_request' if: github.event_name == 'pull_request'
with: with:
name: ConfusedPolarBear.Plugin.IntroSkipper-${{ env.SANITIZED_BRANCH_NAME }}.dll name: ConfusedPolarBear.Plugin.IntroSkipper-${{ env.SANITIZED_BRANCH_NAME }}.dll
path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
retention-days: 7 retention-days: 7
if-no-files-found: error if-no-files-found: error
- name: Create archive - name: Create archive
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
run: zip -j "intro-skipper-${{ env.GIT_HASH }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll run: zip -j "intro-skipper-${{ env.GIT_HASH }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
- name: Create/replace the preview release and upload artifacts - name: Create/replace the preview release and upload artifacts
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
run: | run: |
gh release delete '10.9/preview' --cleanup-tag --yes || true gh release delete '10.9/preview' --cleanup-tag --yes || true
gh release create '10.9/preview' "intro-skipper-${{ env.GIT_HASH }}.zip" --prerelease --title "intro-skipper-${{ env.GIT_HASH }}" --notes "This is a prerelease version." gh release create '10.9/preview' "intro-skipper-${{ env.GIT_HASH }}.zip" --prerelease --title "intro-skipper-${{ env.GIT_HASH }}" --notes "This is a prerelease version."
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -2,21 +2,21 @@ name: "CodeQL"
on: on:
push: push:
branches: [ master ] branches: [master]
paths-ignore: paths-ignore:
- '**/README.md' - "**/README.md"
- '.github/ISSUE_TEMPLATE/**' - ".github/ISSUE_TEMPLATE/**"
- 'docs/**' - "docs/**"
- 'images/**' - "images/**"
- 'manifest.json' - "manifest.json"
pull_request: pull_request:
branches: [ master ] branches: [master]
paths-ignore: paths-ignore:
- '**/README.md' - "**/README.md"
- '.github/ISSUE_TEMPLATE/**' - ".github/ISSUE_TEMPLATE/**"
- 'docs/**' - "docs/**"
- 'images/**' - "images/**"
- 'manifest.json' - "manifest.json"
permissions: write-all permissions: write-all
@ -31,30 +31,30 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
language: [ 'csharp' ] language: ["csharp"]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v4
with: with:
dotnet-version: 8.0.x dotnet-version: 8.0.x
- name: Install dependencies - name: Install dependencies
run: | run: |
dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name jellyfin-pre "https://nuget.pkg.github.com/jellyfin/index.json" dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name jellyfin-pre "https://nuget.pkg.github.com/jellyfin/index.json"
dotnet tool install --global dotnet-outdated-tool dotnet tool install --global dotnet-outdated-tool
dotnet outdated -pre Always -u -inc Jellyfin dotnet outdated -pre Always -u -inc Jellyfin
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10 uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
queries: +security-extended queries: +security-extended
- name: Autobuild
uses: github/codeql-action/autobuild@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
- name: Perform CodeQL Analysis - name: Autobuild
uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10 uses: github/codeql-action/autobuild@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10

View File

@ -1,4 +1,4 @@
name: 'Release Plugin' name: "Release Plugin"
on: on:
workflow_dispatch: workflow_dispatch:
@ -8,74 +8,73 @@ permissions:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup Node.js - name: Setup .NET
uses: actions/setup-node@v4 uses: actions/setup-dotnet@v4
with: with:
node-version: 'lts/*' dotnet-version: 8.0.x
- name: Install html-minifier-terser - name: Setup Node.js
run: npm install terser html-minifier-terser uses: actions/setup-node@v4
with:
- name: Minify HTML node-version: "lts/*"
run: |
- name: Install html-minifier-terser
run: npm install terser html-minifier-terser
- name: Minify HTML
run: |
npx html-minifier-terser --collapse-boolean-attributes --collapse-whitespace --collapse-inline-tag-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html npx html-minifier-terser --collapse-boolean-attributes --collapse-whitespace --collapse-inline-tag-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html
npx terser ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js -c -m npx terser ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js -c -m
npx terser ConfusedPolarBear.Plugin.IntroSkipper/Configuration/visualizer.js -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/visualizer.js -c -m npx terser ConfusedPolarBear.Plugin.IntroSkipper/Configuration/visualizer.js -o ConfusedPolarBear.Plugin.IntroSkipper/Configuration/visualizer.js -c -m
- name: Restore dependencies
run: dotnet restore
- name: Run update version - name: Restore dependencies
uses: intro-skipper/intro-skipper-action-ts@main run: dotnet restore
with:
task-type: 'updateVersion'
- name: Embed version info - name: Run update version
run: | uses: intro-skipper/intro-skipper-action-ts@main
GITHUB_SHA=${{ github.sha }} with:
sed -i "s/string\.Empty/\"$GITHUB_SHA\"/g" ConfusedPolarBear.Plugin.IntroSkipper/Helper/Commit.cs task-type: "updateVersion"
- name: Build - name: Embed version info
run: dotnet build --configuration Release --no-restore run: |
GITHUB_SHA=${{ github.sha }}
sed -i "s/string\.Empty/\"$GITHUB_SHA\"/g" ConfusedPolarBear.Plugin.IntroSkipper/Helper/Commit.cs
- name: Create archive - name: Build
run: zip -j "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Release/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll run: dotnet build --configuration Release --no-restore
- name: Remove old release if exits - name: Create archive
if: ${{ github.repository == 'intro-skipper/intro-skipper-test' }} run: zip -j "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Release/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
run: gh release delete "10.9/v${{ env.NEW_FILE_VERSION }}" --cleanup-tag --yes || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create new release with tag - name: Remove old release if exits
if: github.event_name != 'pull_request' if: ${{ github.repository == 'intro-skipper/intro-skipper-test' }}
run: gh release create "10.9/v${{ env.NEW_FILE_VERSION }}" "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" --title "v${{ env.NEW_FILE_VERSION }}" --latest --generate-notes run: gh release delete "10.9/v${{ env.NEW_FILE_VERSION }}" --cleanup-tag --yes || true
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run validation and update script - name: Create new release with tag
uses: intro-skipper/intro-skipper-action-ts@main if: github.event_name != 'pull_request'
with: run: gh release create "10.9/v${{ env.NEW_FILE_VERSION }}" "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" --title "v${{ env.NEW_FILE_VERSION }}" --latest --generate-notes
task-type: 'updateManifest' env:
env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO_VISIBILITY: ${{ github.event.repository.visibility }}
- name: Commit changes - name: Run validation and update script
if: success() uses: intro-skipper/intro-skipper-action-ts@main
run: | with:
git config --global user.name "github-actions[bot]" task-type: "updateManifest"
git config --global user.email "github-actions[bot]@users.noreply.github.com" env:
git add README.md manifest.json ConfusedPolarBear.Plugin.IntroSkipper/ConfusedPolarBear.Plugin.IntroSkipper.csproj .github/ISSUE_TEMPLATE/bug_report_form.yml GITHUB_REPO_VISIBILITY: ${{ github.event.repository.visibility }}
git commit -m "release v${{ env.NEW_FILE_VERSION }}"
git push - name: Commit changes
if: success()
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add README.md manifest.json ConfusedPolarBear.Plugin.IntroSkipper/ConfusedPolarBear.Plugin.IntroSkipper.csproj .github/ISSUE_TEMPLATE/bug_report_form.yml
git commit -m "release v${{ env.NEW_FILE_VERSION }}"
git push

View File

@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '>=20' node-version: ">=20"
- name: Checkout official jellyfin-web - name: Checkout official jellyfin-web
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with: