From 68f5e0871038b695b9bc9323ee6c94cbbb7830b9 Mon Sep 17 00:00:00 2001 From: h1dden-da3m0n <33120068+h1dden-da3m0n@users.noreply.github.com> Date: Sat, 19 Jun 2021 21:24:08 +0200 Subject: [PATCH 1/6] update to slow down dependabot --- .github/dependabot.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 602a26a..325dec4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,9 +4,12 @@ updates: - package-ecosystem: nuget directory: / schedule: - interval: daily - time: '00:00' + interval: weekly open-pull-requests-limit: 10 + labels: + - chore + - dependency + - nuget commit-message: prefix: chore include: scope @@ -15,9 +18,12 @@ updates: - package-ecosystem: github-actions directory: / schedule: - interval: weekly - time: '00:00' + interval: monthly open-pull-requests-limit: 10 + labels: + - ci + - dependency + - github_actions commit-message: - prefix: chore + prefix: ci include: scope From 342b4a38e53287019b66c6bb0899208b52ff971d Mon Sep 17 00:00:00 2001 From: h1dden-da3m0n <33120068+h1dden-da3m0n@users.noreply.github.com> Date: Sat, 19 Jun 2021 21:24:16 +0200 Subject: [PATCH 2/6] remove useless workflow --- .github/workflows/create-github-release.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/create-github-release.yml diff --git a/.github/workflows/create-github-release.yml b/.github/workflows/create-github-release.yml deleted file mode 100644 index 3a37d86..0000000 --- a/.github/workflows/create-github-release.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Publish Drafted GitHub Release - -on: - push: - tags: [ 'v*' ] - -jobs: - publish_release_draft: - runs-on: ubuntu-latest - if: github.repository == 'jellyfin/jellyfin-plugin-reports' - - steps: - - name: Get version from GITHUB_REF - id: get-version - run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}" - - - name: Publish release on GitHub - uses: test-room-7/action-publish-release-drafts@v0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - tag-name: ${{ steps.get-version.outputs.version }} From 77a24da5960b62e450beeeb0e8b09117f8fbb1b6 Mon Sep 17 00:00:00 2001 From: h1dden-da3m0n <33120068+h1dden-da3m0n@users.noreply.github.com> Date: Sat, 19 Jun 2021 21:24:27 +0200 Subject: [PATCH 3/6] add prepare release PR update to workflow --- .github/workflows/update-release-draft.yml | 59 ++++++++++++++++++++-- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-release-draft.yml b/.github/workflows/update-release-draft.yml index d029678..c6a1f50 100644 --- a/.github/workflows/update-release-draft.yml +++ b/.github/workflows/update-release-draft.yml @@ -5,14 +5,67 @@ on: push: branches: - master + workflow_dispatch: jobs: update_release_draft: runs-on: ubuntu-latest if: github.repository == 'jellyfin/jellyfin-plugin-reports' - + steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.15.0 + - name: Update Draft + uses: release-drafter/release-drafter@v5.15.0 + id: draft env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }} + + - name: Setup YQ + uses: chrisdickinson/setup-yq@latest + with: + yq-version: v4.9.6 + + - name: Parse changelog + 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 + + rm cl.md + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Update build.yaml + run: | + yq eval '.version = env(VERSION) | .changelog = strenv(CHANGELOG) | .changelog style="literal"' -i build.yaml + + - name: Commit Changes + 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 + 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 }} From 8509d00f438cdfde5dd645d5cda694403c7c26b3 Mon Sep 17 00:00:00 2001 From: h1dden-da3m0n <33120068+h1dden-da3m0n@users.noreply.github.com> Date: Sat, 19 Jun 2021 21:24:36 +0200 Subject: [PATCH 4/6] update build workflow --- .github/workflows/build-dotnet.yml | 19 ++++++++++-------- .github/workflows/test-dotnet.yml | 31 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/test-dotnet.yml diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml index 6eb996c..279d3b5 100644 --- a/.github/workflows/build-dotnet.yml +++ b/.github/workflows/build-dotnet.yml @@ -1,4 +1,4 @@ -name: Test Build Plugin +name: Build Plugin on: push: @@ -21,11 +21,14 @@ jobs: with: dotnet-version: 5.0.x - - name: Install dependencies - run: dotnet restore + - name: Build Jellyfin Plugin + uses: oddstr13/jellyfin-plugin-repository-manager@v0.4.2 + id: jprm - - name: Build - run: dotnet build --configuration Release --no-restore - - - name: Test - run: dotnet test --no-restore --verbosity normal + - 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/test-dotnet.yml b/.github/workflows/test-dotnet.yml new file mode 100644 index 0000000..05f2b13 --- /dev/null +++ b/.github/workflows/test-dotnet.yml @@ -0,0 +1,31 @@ +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: 5.0.x + + - name: Install dependencies + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --no-restore --verbosity normal From 0363ce7ad4aae3c681fd31714177fea9b4f587a8 Mon Sep 17 00:00:00 2001 From: h1dden-da3m0n <33120068+h1dden-da3m0n@users.noreply.github.com> Date: Sun, 4 Jul 2021 01:13:19 +0200 Subject: [PATCH 5/6] add label-sync workflow --- .github/workflows/label-sync.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/label-sync.yml diff --git a/.github/workflows/label-sync.yml b/.github/workflows/label-sync.yml new file mode 100644 index 0000000..bb04293 --- /dev/null +++ b/.github/workflows/label-sync.yml @@ -0,0 +1,16 @@ +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 }} From 2a4a6959e36c8b17469a8bd25ba9403488e7d841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Sun, 11 Jul 2021 13:52:55 +0200 Subject: [PATCH 6/6] Update .github/dependabot.yml --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 325dec4..53f1fec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -23,7 +23,7 @@ updates: labels: - ci - dependency - - github_actions + - github-actions commit-message: prefix: ci include: scope