Files
tubearchivist-jf-plugin/.github/workflows/build.yaml
T

74 lines
2.1 KiB
YAML

name: Stable Release
on:
release:
types:
- released
branches: master
jobs:
build:
runs-on: ubuntu-latest
name: Build & Release
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Get release version
id: newtag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Setup .Net
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Get version number only
run: |
TAG=${{ github.event.release.tag_name }}
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Generate release message
run: |
# Read the YAML file and extract the value of the 'changelog' field
changelog=$(awk '/changelog:/ {flag=1; next} /^[^ ]/ {flag=0} flag' build.yaml | awk '{$1=$1};1')
# Check if changelog contains multiple lines
if [[ $(echo "$changelog" | wc -l) -gt 1 ]]; then
changelog=$(echo "$changelog" | sed 's/^/*/')
else
changelog="*$changelog"
fi
echo "RELEASE_MESSAGE=$(echo Changelog:; echo $changelog)" >> $GITHUB_ENV
- name: Build Jellyfin Plugin
uses: oddstr13/jellyfin-plugin-repository-manager@843260fcdfda7cba229c5abd77bdd9c6fc4e850b # v1.1.0
id: jprm
with:
dotnet-target: net6.0
version: ${VERSION}
- name: Upload Release
uses: svenstaro/upload-release-action@v2
id: upload
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.jprm.outputs.artifact }}
tag: ${{ github.ref }}
asset_name: TubeArchivistMetadata-${{ env.VERSION }}.zip
body: ${{ env.RELEASE_MESSAGE }}
- name: Update manifest.json
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
commit_message: "Update manifest.json"
file_pattern: manifest.json
skip_fetch: true