From a670d131d41f8ec11b0d2b311bfded0512230343 Mon Sep 17 00:00:00 2001 From: Bram Date: Sat, 22 Aug 2026 22:11:25 +0200 Subject: [PATCH] Public gitea --- .gitea/workflows/release_jellyfin_plugin.yml | 21 ++++++++++---------- Jellyfin/README.md | 10 +++++++++- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/release_jellyfin_plugin.yml b/.gitea/workflows/release_jellyfin_plugin.yml index 30f2b88..bfb217f 100644 --- a/.gitea/workflows/release_jellyfin_plugin.yml +++ b/.gitea/workflows/release_jellyfin_plugin.yml @@ -79,19 +79,20 @@ jobs: if: steps.detect.outputs.plugins != '' env: GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Public base URL for manifest sourceUrl (no trailing slash), e.g. https://gitea.example.com + GITEA_PUBLIC_URL: ${{ secrets.GITEA_PUBLIC_URL }} PLUGINS: ${{ steps.detect.outputs.plugins }} run: | set -euo pipefail - GITEA_URL="${{ github.server_url }}" + if [[ -z "${PUBLIC_GITEA_URL:-}" ]]; then + echo "Secret PUBLIC_GITEA_URL is not set (public Gitea base URL for plugin catalog sourceUrl)" + exit 1 + fi + GITEA_API_URL="${{ github.server_url }}" REPO_OWNER="${{ github.repository_owner }}" REPO_NAME="${{ github.event.repository.name }}" - - git config user.name "gitea-actions" - git config user.email "actions@local" - manifest_dirty=0 - while IFS= read -r SLUG; do [[ -z "$SLUG" ]] && continue @@ -109,7 +110,7 @@ jobs: # Skip if this version was already released HTTP=$(curl -sS -o /tmp/rel.json -w "%{http_code}" \ -H "Authorization: token ${GITEA_TOKEN}" \ - "${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/tags/${TAG}") + "${GITEA_API_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/tags/${TAG}") if [[ "$HTTP" == "200" ]]; then echo "Release ${TAG} already exists — skipping build" echo "::endgroup::" @@ -136,7 +137,7 @@ jobs: RESPONSE=$(curl -sS -w "\n%{http_code}" -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/json" \ - "${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases" \ + "${GITEA_API_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases" \ -d "{ \"tag_name\": \"${TAG}\", \"name\": \"${SLUG} ${VERSION}\", @@ -157,9 +158,9 @@ jobs: -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/zip" \ --data-binary "@${ARTIFACT}" \ - "${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=${ARTIFACT_NAME}" + "${GITEA_API_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=${ARTIFACT_NAME}" - DOWNLOAD_URL="${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/releases/download/${TAG}/${ARTIFACT_NAME}" + DOWNLOAD_URL="${GITEA_PUBLIC_URL}/${REPO_OWNER}/${REPO_NAME}/releases/download/${TAG}/${ARTIFACT_NAME}" TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ") GUID=$(grep -E '^guid:' "${PLUGIN_DIR}/build.yaml" | head -1 | sed -E 's/guid:[[:space:]]*"?([^"]*)"?/\1/') TARGET_ABI=$(grep -E '^targetAbi:' "${PLUGIN_DIR}/build.yaml" | head -1 | sed -E 's/targetAbi:[[:space:]]*"?([^"]*)"?/\1/') diff --git a/Jellyfin/README.md b/Jellyfin/README.md index 5787c8c..3446dc3 100644 --- a/Jellyfin/README.md +++ b/Jellyfin/README.md @@ -23,4 +23,12 @@ https://///raw/branch//Jellyfin/manifest.json - **Scaffold:** `.gitea/workflows/scaffold_jellyfin_plugin.yml` (`workflow_dispatch`) - **Release:** `.gitea/workflows/release_jellyfin_plugin.yml` — on push to `Jellyfin/**`, builds each changed plugin that has `build.yaml` + `version` -Bump `Jellyfin//version` before pushing when you want a new release. Re-pushing the same version skips (release already exists). \ No newline at end of file +Bump `Jellyfin//version` before pushing when you want a new release. Re-pushing the same version skips (release already exists). + +### Required secret + +| Secret | Example | Used for | +|---|---|---| +| `GITEA_PUBLIC_URL` | `https://gitea.example.com` | `sourceUrl` in `manifest.json` (no trailing slash) | + +API calls still use the runner’s internal Gitea URL; only catalog download links use this secret. \ No newline at end of file