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 <