Merge pull request #27 from h1dden-da3m0n/update/ci

This commit is contained in:
Cody Robibero 2021-07-09 09:32:12 -06:00 committed by GitHub
commit c90685fca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 125 additions and 37 deletions

View File

@ -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

View File

@ -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 }}

View File

@ -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-fanart'
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 }}

16
.github/workflows/label-sync.yml vendored Normal file
View File

@ -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 }}

31
.github/workflows/test-dotnet.yml vendored Normal file
View File

@ -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

View File

@ -5,14 +5,67 @@ on:
push:
branches:
- master
workflow_dispatch:
jobs:
update_release_draft:
runs-on: ubuntu-latest
if: github.repository == 'jellyfin/jellyfin-plugin-fanart'
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<<EOF" >> $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 }}