diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml deleted file mode 100644 index ae8a851..0000000 --- a/.github/workflows/build-dotnet.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build Plugin - -on: - push: - branches: [ master ] - paths-ignore: - - '**/*.md' - pull_request: - branches: [ master ] - paths-ignore: - - '**/*.md' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - include-prerelease: true - - - name: Build Jellyfin Plugin - uses: oddstr13/jellyfin-plugin-repository-manager@v0.4.2 - id: jprm - with: - dotnet-target: net6.0 - - - name: Upload Artifact - uses: actions/upload-artifact@v2 - with: - name: build-artifact - retention-days: 30 - if-no-files-found: error - path: ${{ steps.jprm.outputs.artifact }} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..f290747 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,18 @@ +name: '๐Ÿ—๏ธ Build Plugin' + +on: + push: + branches: + - master + paths-ignore: + - '**/*.md' + pull_request: + branches: + - master + paths-ignore: + - '**/*.md' + workflow_dispatch: + +jobs: + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/build.yaml@master diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml new file mode 100644 index 0000000..3e7de60 --- /dev/null +++ b/.github/workflows/bump-version.yaml @@ -0,0 +1,14 @@ +name: "๐Ÿ†™ Bump Version" + +on: + release: + types: + - published + workflow_dispatch: + +jobs: + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/bump-version.yaml@master + with: + csproj-name: Jellyfin.Plugin.AniSearch + is-unstable: ${{ github.event.release.prerelease }} diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml new file mode 100644 index 0000000..9798196 --- /dev/null +++ b/.github/workflows/changelog.yaml @@ -0,0 +1,20 @@ +name: '๐Ÿ“ Create/Update Release Draft & Release Bump PR' + +on: + push: + branches: + - master + paths-ignore: + - build.yaml + workflow_dispatch: + repository_dispatch: + types: + - update-prep-command + +jobs: + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/changelog.yaml@master + with: + repository-name: jellyfin/jellyfin-plugin-anisearch + secrets: + token: ${{ secrets.JF_BOT_TOKEN }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index a64607a..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Run CodeQL - -on: - push: - branches: [ master ] - paths-ignore: - - '**/*.md' - pull_request: - branches: [ master ] - paths-ignore: - - '**/*.md' - schedule: - - cron: '24 2 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - if: github.repository == 'jellyfin/jellyfin-plugin-anisearch' - - strategy: - fail-fast: false - matrix: - language: [ 'csharp' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - include-prerelease: true - - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - queries: +security-and-quality - - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/command-dispatch.yaml b/.github/workflows/command-dispatch.yaml index 538de2b..66b1703 100644 --- a/.github/workflows/command-dispatch.yaml +++ b/.github/workflows/command-dispatch.yaml @@ -1,5 +1,5 @@ # Allows for the definition of PR and Issue /commands -name: Slash Command Dispatcher +name: '๐Ÿ“Ÿ Slash Command Dispatcher' on: issue_comment: @@ -7,15 +7,7 @@ on: - created jobs: - launcher: - runs-on: ubuntu-latest - steps: - - name: Command Dispatch - uses: peter-evans/slash-command-dispatch@v2 - with: - token: ${{ secrets.JF_BOT_TOKEN }} - permission: write - issue-type: pull-request - commands: |- - rebase - update-prep + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/command-dispatch.yaml@master + secrets: + token: ${{ secrets.JF_BOT_TOKEN }} diff --git a/.github/workflows/command-rebase.yaml b/.github/workflows/command-rebase.yaml index b2faf80..fa3cbbc 100644 --- a/.github/workflows/command-rebase.yaml +++ b/.github/workflows/command-rebase.yaml @@ -1,4 +1,4 @@ -name: PR Rebase Command +name: '๐Ÿ”€ PR Rebase Command' on: repository_dispatch: @@ -6,29 +6,11 @@ on: - rebase-command jobs: - rebase: - runs-on: ubuntu-latest - steps: - - name: Rebase PR - uses: peter-evans/rebase@v1 - id: rebase - with: - head: ${{ github.event.client_payload.pull_request.head.label }} - - - name: Add Success Reaction - if: ${{ steps.rebase.outputs.rebased-count == 1 }} - uses: peter-evans/create-or-update-comment@v1 - with: - token: ${{ secrets.JF_BOT_TOKEN }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - reaction-type: hooray - - - name: Add Failure Reaction - if: ${{ steps.rebase.outputs.rebased-count == 0 || failure() }} - uses: peter-evans/create-or-update-comment@v1 - with: - token: ${{ secrets.JF_BOT_TOKEN }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - reaction-type: confused, -1 + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/command-rebase.yaml@master + with: + rebase-head: ${{ github.event.client_payload.pull_request.head.label }} + repository-full-name: ${{ github.event.client_payload.github.payload.repository.full_name }} + comment-id: ${{ github.event.client_payload.github.payload.comment.id }} + secrets: + token: ${{ secrets.JF_BOT_TOKEN }} diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml deleted file mode 100644 index bb04293..0000000 --- a/.github/workflows/label-sync.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Sync labels -on: - schedule: - - cron: '0 0 1 * *' - workflow_dispatch: - -jobs: - labels: - runs-on: ubuntu-latest - - steps: - - uses: EndBug/label-sync@v2 - with: - config-file: https://raw.githubusercontent.com/jellyfin/jellyfin-meta-plugins/master/.github/plugin-repo-labels.yaml - delete-other-labels: true - token: ${{ secrets.JF_BOT_TOKEN }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..80483cf --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,18 @@ +name: '๐Ÿš€ Publish Plugin' + +on: + release: + types: + - released + workflow_dispatch: + +jobs: + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/publish.yaml@master + with: + version: ${{ github.event.release.tag_name }} + is-unstable: ${{ github.event.release.prerelease }} + secrets: + deploy-host: ${{ secrets.DEPLOY_HOST }} + deploy-user: ${{ secrets.DEPLOY_USER }} + deploy-key: ${{ secrets.DEPLOY_KEY }} diff --git a/.github/workflows/scan-codeql.yaml b/.github/workflows/scan-codeql.yaml new file mode 100644 index 0000000..fcfd568 --- /dev/null +++ b/.github/workflows/scan-codeql.yaml @@ -0,0 +1,12 @@ +name: '๐Ÿ”ฌ Run CodeQL' + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/scan-codeql.yaml@master + with: + repository-name: jellyfin/jellyfin-plugin-anisearch diff --git a/.github/workflows/sync-labels.yaml b/.github/workflows/sync-labels.yaml new file mode 100644 index 0000000..5e06ae4 --- /dev/null +++ b/.github/workflows/sync-labels.yaml @@ -0,0 +1,12 @@ +name: '๐Ÿท๏ธ Sync labels' + +on: + schedule: + - cron: '0 0 1 * *' + workflow_dispatch: + +jobs: + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/sync-labels.yaml@master + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-dotnet.yml b/.github/workflows/test-dotnet.yml deleted file mode 100644 index a809342..0000000 --- a/.github/workflows/test-dotnet.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Test Plugin - -on: - push: - branches: [ master ] - paths-ignore: - - '**/*.md' - pull_request: - branches: [ master ] - paths-ignore: - - '**/*.md' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - include-prerelease: true - - - name: Install dependencies - run: dotnet restore - - - name: Build - run: dotnet build --configuration Release --no-restore - - - name: Test - run: dotnet test --no-restore --verbosity normal diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..d90b14d --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,18 @@ +name: '๐Ÿงช Test Plugin' + +on: + push: + branches: + - master + paths-ignore: + - '**/*.md' + pull_request: + branches: + - master + paths-ignore: + - '**/*.md' + workflow_dispatch: + +jobs: + call: + uses: jellyfin/jellyfin-meta-plugins/.github/workflows/test.yaml@master diff --git a/.github/workflows/update-release-draft.yml b/.github/workflows/update-release-draft.yml deleted file mode 100644 index 0f3b05d..0000000 --- a/.github/workflows/update-release-draft.yml +++ /dev/null @@ -1,83 +0,0 @@ -# Automates creation of Release Drafts using Release Drafter -name: Update Release Draft & Create Release Bump PR - -on: - push: - branches: - - master - paths-ignore: - - build.yaml - workflow_dispatch: - repository_dispatch: - types: - - update-prep-command - -jobs: - update_release_draft: - runs-on: ubuntu-latest - if: github.repository == 'jellyfin/jellyfin-plugin-anisearch' - - steps: - # Drafts your next Release notes as Pull Requests are merged into "master" - - name: Update Draft - uses: release-drafter/release-drafter@v5.15.0 - id: draft - env: - GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }} - - - name: Setup YQ - uses: chrisdickinson/setup-yq@latest - with: - yq-version: v4.12.2 - - - name: Set-up Environment - run: | - TAG="${{ steps.draft.outputs.tag_name }}" - echo "VERSION=${TAG#v}" >> $GITHUB_ENV - - cat << EOF | grep -P '^([*-] |###)' > cl.md - ${{ steps.draft.outputs.body }} - EOF - - sed -i -r 's/^(#+) (:.*:)? *(.*)$/\n\1 \3 \1/' cl.md - sed -i -r 's/^\*/-/' cl.md - - echo "CHANGELOG<> $GITHUB_ENV - cat cl.md >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - echo "HAS_CHANGES=$(grep -qie 'No changes$' cl.md && echo false || echo true)" >> $GITHUB_ENV - rm cl.md - - echo "ABI_VERSION=$(curl -s https://api.jellyfin.org/openapi/jellyfin-openapi-stable.json | jq -r '.info.version').0" >> $GITHUB_ENV - - - name: Checkout Repository - if: ${{ env.HAS_CHANGES == 'true' }} - uses: actions/checkout@v2 - - - name: Update build.yaml - if: ${{ env.HAS_CHANGES == 'true' }} - run: | - yq eval '.version = env(VERSION) | .targetAbi = env(ABI_VERSION) | .changelog = strenv(CHANGELOG) | .changelog style="literal"' -i build.yaml - - - name: Commit Changes - if: ${{ env.HAS_CHANGES == 'true' }} - run: | - git config user.name "jellyfin-bot" - git config user.email "team@jellyfin.org" - git checkout -b prepare-${{ env.VERSION }} - git commit -am "Bump version to ${{ env.VERSION }}" - git push -f origin prepare-${{ env.VERSION }} - - - name: Create or Update PR - if: ${{ env.HAS_CHANGES == 'true' }} - uses: k3rnels-actions/pr-update@v1 - with: - token: ${{ secrets.JF_BOT_TOKEN }} - pr_title: Prepare for release ${{ steps.draft.outputs.tag_name }} - pr_source: prepare-${{ env.VERSION }} - pr_labels: 'release-prep,skip-changelog' - pr_body: | - :robot: This is a generated PR to update version and changelog in `build.yaml`. - --- - ${{ env.CHANGELOG }} diff --git a/build.yaml b/build.yaml index 4f95802..4318316 100644 --- a/build.yaml +++ b/build.yaml @@ -1,7 +1,7 @@ name: "AniSearch" guid: "776d9158-b91f-49d9-82c5-dacce63d63b8" imageUrl: "https://repo.jellyfin.org/releases/plugin/images/jellyfin-plugin-anisearch.png" -version: "4" +version: "5" targetAbi: "10.8.0.0" framework: "net6.0" owner: "jellyfin"