Files
blackBarRemover/.gitea/workflows/release.yml
T
karol 16493b0735
Build and Release Plugin / release (push) Successful in 22s
Fix URLs for external WAN access (labus.uk)
2026-09-17 14:52:19 +02:00

99 lines
3.5 KiB
YAML

name: Build and Release Plugin
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '10.0.x'
- name: Build Plugin
run: dotnet build JellyfinPlugin/JellyfinPlugin.csproj -c Release
- name: Create ZIP Archive
run: |
cd JellyfinPlugin/bin/Release/net10.0/
zip -j ../../../../BlackBarRemover_${{ github.ref_name }}.zip *
- name: Generate Checksum
id: checksum
run: |
MD5_SUM=$(md5sum BlackBarRemover_${{ github.ref_name }}.zip | awk '{print $1}')
echo "md5=$MD5_SUM" >> $GITHUB_OUTPUT
- name: Create Gitea Release
run: |
API_URL="${{ github.api_url }}"
REPO="${{ github.repository }}"
TOKEN="${{ github.token }}"
TAG="${{ github.ref_name }}"
IS_PRERELEASE="false"
if [[ "$TAG" == *"beta"* ]] || [[ "$TAG" == *"alpha"* ]] || [[ "$TAG" == v0.* ]]; then
IS_PRERELEASE="true"
fi
# Create Release
RELEASE_RES=$(curl -s -X POST "$API_URL/repos/$REPO/releases" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\", \"name\":\"Release $TAG\", \"body\":\"Automated release\", \"draft\":false, \"prerelease\":$IS_PRERELEASE}")
REL_ID=$(echo "$RELEASE_RES" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
# Upload Asset
curl -s -X POST "$API_URL/repos/$REPO/releases/$REL_ID/assets" \
-H "Authorization: token $TOKEN" \
-F "attachment=@BlackBarRemover_$TAG.zip"
- name: Update manifest.json
run: |
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
git checkout -B manifest
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}" # remove 'v' prefix
cat > manifest.json <<EOF
[
{
"guid": "12345678-1234-1234-1234-1234567890ab",
"name": "Black Bar Remover",
"description": "Automatically detects and removes black bars from video files.",
"overview": "Automatically detects and removes black bars from video files via CSS or FFmpeg.",
"owner": "karol",
"category": "Playback",
"imageUrl": "",
"versions": [
{
"version": "$VERSION",
"changelog": "Automated Release ${{ github.ref_name }}",
"targetAbi": "12.0.0.0",
"sourceUrl": "https://gitea.labus.uk/karol/blackBarRemover",
"checksum": "${{ steps.checksum.outputs.md5 }}",
"timestamp": "$(date -u +'%Y-%m-%dT%H:%M:%SZ')",
"repositoryUrl": "https://gitea.labus.uk/karol/blackBarRemover/releases/download/${{ github.ref_name }}/BlackBarRemover_${{ github.ref_name }}.zip"
}
]
}
]
EOF
git add manifest.json
git commit -m "Update manifest for ${{ github.ref_name }}"
git push -f origin manifest