From c8aad996068e023c34ae52d9d505b1e61e027a0c Mon Sep 17 00:00:00 2001 From: masi Date: Fri, 25 Sep 2026 12:08:46 -0300 Subject: [PATCH] chore: publish plugins to self-hosted Gitea Add publish:gitea wrapper that sets USER_CONTENT_BASE to Gitea raw URLs, and resolve the lockfile's npmmirror tarballs from registry.npmjs.org. Co-Authored-By: Claude Opus 5.5 --- package-lock.json | 4 ++-- package.json | 3 ++- scripts/publish-gitea.sh | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100755 scripts/publish-gitea.sh diff --git a/package-lock.json b/package-lock.json index d297a38..0a92adc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4943,7 +4943,7 @@ }, "node_modules/domhandler": { "version": "5.0.3", - "resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, "license": "BSD-2-Clause", @@ -12590,7 +12590,7 @@ }, "domhandler": { "version": "5.0.3", - "resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, "requires": { diff --git a/package.json b/package.json index fb2cfd6..c9b8a5f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "format:check": "prettier --check \"./**/*.{js,ts}\"", "check:sites": "node scripts/check-plugin-sites.js", "check:plugin": "node scripts/live-check-plugin.js", - "prepare": "husky" + "prepare": "husky", + "publish:gitea": "./scripts/publish-gitea.sh" }, "author": "LNReader", "license": "MIT", diff --git a/scripts/publish-gitea.sh b/scripts/publish-gitea.sh new file mode 100755 index 0000000..aa68bb8 --- /dev/null +++ b/scripts/publish-gitea.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Publish plugins to the self-hosted Gitea repo instead of GitHub. +# The manifest must reference Gitea raw URLs, which the upstream script +# derives from USER_CONTENT_BASE. +set -e + +GITEA_BASE="${GITEA_BASE:-https://git.marcospaulo.dev.br}" +version=$(node -e "console.log(require('./package.json').version);") +repo_path=$(git remote get-url origin | sed -E 's#^.*[:/]([^/:]+/[^/]+?)(\.git)?$#\1#; s#\.git$##') + +export USER_CONTENT_BASE="$GITEA_BASE/$repo_path/raw/branch/plugins/v$version" +echo "Manifest base: $USER_CONTENT_BASE" + +./scripts/publish-plugins.sh +echo "Repository URL for LNReader: $USER_CONTENT_BASE/.dist/plugins.min.json"