76 lines
2.1 KiB
YAML
76 lines
2.1 KiB
YAML
name: Publish Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: |
|
|
9.x
|
|
10.x
|
|
|
|
- name: Extract version
|
|
id: ver
|
|
run: |
|
|
RAW="${GITHUB_REF_NAME#v}"
|
|
PARTS=$(echo "$RAW" | tr '.' '\n' | wc -l)
|
|
if [ "$PARTS" -eq 3 ]; then RAW="${RAW}.0"; fi
|
|
echo "ver=$RAW" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build net9.0
|
|
run: dotnet publish AutoBackup.csproj -c Release -f net9.0 --nologo
|
|
|
|
- name: Build net10.0
|
|
run: dotnet publish AutoBackup.csproj -c Release -f net10.0 --nologo
|
|
|
|
- name: Install jprm
|
|
run: pip install jprm --break-system-packages
|
|
|
|
- name: Package artifacts
|
|
run: |
|
|
mkdir -p artifacts
|
|
VER="${{ steps.ver.outputs.ver }}"
|
|
|
|
cd publish/net9.0
|
|
zip -j "${GITHUB_WORKSPACE}/artifacts/autobackup_${VER}_net9.zip" \
|
|
Jellyfin.Plugin.AutoBackup.dll
|
|
cd "${GITHUB_WORKSPACE}"
|
|
|
|
cd publish/net10.0
|
|
zip -j "${GITHUB_WORKSPACE}/artifacts/autobackup_${VER}_net10.zip" \
|
|
Jellyfin.Plugin.AutoBackup.dll
|
|
cd "${GITHUB_WORKSPACE}"
|
|
|
|
- name: Update manifest.json
|
|
run: |
|
|
jprm repo add \
|
|
--url="${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/" \
|
|
manifest.json \
|
|
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 }}
|