build: add gitea api url fallback
Build / build (push) Successful in 3m10s

This commit is contained in:
dmg
2026-01-22 22:42:07 -05:00
parent 902ef5806c
commit f4682689d6
2 changed files with 11 additions and 2 deletions
+9 -1
View File
@@ -59,6 +59,8 @@ jobs:
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_API: ${{ vars.GITEA_API_URL }}
GITEA_SERVER_URL: ${{ vars.GITEA_SERVER_URL }}
GITHUB_SERVER_URL: ${{ github.server_url }}
run: |
TAG=$(git describe --tags --exact-match 2>/dev/null || true)
if [ -z "$TAG" ]; then
@@ -66,9 +68,15 @@ jobs:
exit 0
fi
if [ -z "$GITEA_API" ]; then
echo "GITEA_API_URL is not set in repo variables."
if [ -n "$GITEA_SERVER_URL" ]; then
GITEA_API="${GITEA_SERVER_URL}/api/v1"
elif [ -n "$GITHUB_SERVER_URL" ]; then
GITEA_API="${GITHUB_SERVER_URL}/api/v1"
else
echo "GITEA_API_URL is not set and server URL is unavailable."
exit 1
fi
fi
VERSION=${TAG#v}
JAR_PATH=$(ls build/libs/*.jar | head -n 1)
RELEASE_ID=$(curl -sS -X POST \
+1
View File
@@ -73,6 +73,7 @@ The Gitea workflow expects these secrets/variables:
- `GITEA_TOKEN`: built-in Actions token with repo write access for tags/releases.
- `GITEA_API_URL`: API base URL, for example `https://git.garvis.dev/api/v1`.
- Optional fallback: `GITEA_SERVER_URL` or the runner `GITHUB_SERVER_URL` are used if the API URL is not set.
## Metrics