Skip to content

config: integrate SVG into HTML for offline usage #46

config: integrate SVG into HTML for offline usage

config: integrate SVG into HTML for offline usage #46

Workflow file for this run

name: '🚀 Publish Plugin'
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
dotnet-version:
required: false
default: "9.0.x"
description: "The .NET version to setup for the build"
type: string
dotnet-target:
required: false
default: "net9.0"
description: "The .NET target to set for JPRM"
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: '0'
- name: Setup .NET
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
with:
dotnet-version: "${{ inputs.dotnet-version }}"
- name: Update build.yaml
run: |-
echo "set version to ${GITHUB_REF#refs/tags/}"
sed -i "s/version: .*/version: '${GITHUB_REF#refs/tags/}'/" ./src/build.yaml
COMMIT_RANGE=$(git describe --tags --abbrev=0 @^)..@
echo "generate changelog for commit range ${COMMIT_RANGE}"
CHANGELOG=$(git log "$COMMIT_RANGE" --oneline --pretty=format:"- [%h] %s")
sed -i 's/changelog: changelog/changelog: |-\n/' ./src/build.yaml
echo -e "$CHANGELOG" | sed 's/^/ /' >> ./src/build.yaml
mkdir -p ./artifacts
echo -e "$CHANGELOG" > ./artifacts/changelog.md
- name: Build Jellyfin Plugin
uses: oddstr13/jellyfin-plugin-repository-manager@9497a0a499416cc572ed2e07a391d9f943a37b4d # v1.1.1
id: jprm
with:
dotnet-target: "${{ inputs.dotnet-target }}"
path: './src'
output: './artifacts'
- name: Upload Artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: build-artifact
retention-days: 30
if-no-files-found: error
path: |
./artifacts/changelog.md
./artifacts/*.zip
upload:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: build-artifact
- name: Prepare GH Release Assets
run: |-
mv ./changelog.md /tmp/changelog.md
for file in ./*; do
md5sum ${file#./} >> ${file%.*}.md5
sha256sum ${file#./} >> ${file%.*}.sha256
done
ls -l
- name: Upload GH Release Assets
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
with:
artifacts: ./*
bodyFile: /tmp/changelog.md
publish:
needs:
- upload
runs-on: ubuntu-latest
permissions: # Job-level permissions configuration starts here
contents: write # 'write' access to repository contents
pull-requests: write # 'write' access to pull requests
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: '0'
ref: "master"
- name: Download Artifact
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: build-artifact
- name: Update manifest.json
run: |-
echo "::group::Installing JPRM"
python3 -m pip install jprm
echo "::endgroup::"
RELEASE_TAG="${GITHUB_REF#refs/tags/}"
echo "set release tag to ${RELEASE_TAG}, get release info..."
RELEASE_INFO=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/tags/${RELEASE_TAG}")
DOWNLOAD_URL=$(echo "$RELEASE_INFO" | jq -r '.assets[] | select(.name | test("\\.zip$")) | .browser_download_url')
echo "download url: ${DOWNLOAD_URL}"
echo "::group::Updating manifest.json"
jprm repo add ./manifest.json "$(ls -d *.zip)" -u "${DOWNLOAD_URL}" -U "${DOWNLOAD_URL}"
echo "::endgroup::"
- name: Commit file
run: |-
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git commit -a -m "Update manifest.json for release ${GITHUB_REF#refs/tags/}"
- name: Push changes
uses: ad-m/github-push-action@77c5b412c50b723d2a4fbc6d71fb5723bcd439aa # v1.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master