105 lines
2.7 KiB
YAML
105 lines
2.7 KiB
YAML
name: Publish Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build-net9:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
PIP_BREAK_SYSTEM_PACKAGES: "1"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: |
|
|
9.0.x
|
|
10.0.x
|
|
|
|
- name: Build (net9.0 / Jellyfin 10.x)
|
|
uses: oddstr13/jellyfin-plugin-repository-manager@v1.1.1
|
|
id: jprm
|
|
with:
|
|
dotnet-target: "net9.0"
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: build-net9
|
|
path: ${{ steps.jprm.outputs.artifact }}
|
|
|
|
build-net10:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
PIP_BREAK_SYSTEM_PACKAGES: "1"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: |
|
|
9.0.x
|
|
10.0.x
|
|
|
|
- name: Set targetAbi for Jellyfin 12.x
|
|
run: |
|
|
sed -i "s/targetAbi:.*/targetAbi: \"12.0.0.0\"/" build.yaml
|
|
|
|
- name: Build (net10.0 / Jellyfin 12.x)
|
|
uses: oddstr13/jellyfin-plugin-repository-manager@v1.1.1
|
|
id: jprm
|
|
with:
|
|
dotnet-target: "net10.0"
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: build-net10
|
|
path: ${{ steps.jprm.outputs.artifact }}
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: [build-net9, build-net10]
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Install jprm
|
|
run: pip install jprm --break-system-packages
|
|
|
|
- name: Rename artifacts
|
|
run: |
|
|
VER="${GITHUB_REF_NAME#v}"
|
|
mv artifacts/build-net9/*.zip "artifacts/build-net9/Jellyfin-AutoBackup-${VER}-10.11.x.zip"
|
|
mv artifacts/build-net10/*.zip "artifacts/build-net10/Jellyfin-AutoBackup-${VER}-12.0.x.zip"
|
|
|
|
- name: Update manifest.json
|
|
run: |
|
|
jprm repo add \
|
|
--url="${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/" \
|
|
. \
|
|
artifacts/**/*.zip
|
|
|
|
- name: Commit manifest.json
|
|
run: |
|
|
git config user.name "gitea-actions"
|
|
git config user.email "actions@noreply.local"
|
|
git add manifest.json
|
|
git diff --staged --quiet || git commit -m "chore: update manifest for ${{ github.ref_name }}"
|
|
git push origin HEAD:${{ github.event.repository.default_branch }}
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: artifacts/**/*.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|