From d849e4276a8b80cd7ac609afa1b298ec23d496f2 Mon Sep 17 00:00:00 2001 From: Karol Labus Date: Thu, 17 Sep 2026 14:45:08 +0200 Subject: [PATCH] Add Gitea Action for automated releases and repository manifest --- .gitea/workflows/release.yml | 93 ++++++++++++++++++++++++++++++++++++ README.md | 13 ++++- 2 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..44a7be1 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,93 @@ +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 }}" + + # 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\":false}") + + 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 < **Repositories**. +2. Click the `+` icon to add a new repository. +3. Enter `Black Bar Remover` as the name. +4. Enter `https://gitea.local.labus.uk/karol/blackBarRemover/raw/branch/manifest/manifest.json` as the Repository URL and save. +5. Go back to the **Catalog** tab, find "Black Bar Remover" under the Playback category, and click **Install**. +6. Restart the Jellyfin server. + +### Method 2: Manual Installation from Releases 1. Go to the **Releases** tab on the Gitea repository page. 2. Download the latest `BlackBarRemover_vX.X.zip` file. 3. Extract the contents of the ZIP file into a new folder named `BlackBarRemover` inside your Jellyfin plugins directory (e.g., `/var/lib/jellyfin/plugins/BlackBarRemover/`). 4. Restart the Jellyfin server. -### Method 2: Building from Source +### Method 3: Building from Source 1. Clone this repository. 2. Build the plugin using the .NET 10 SDK: