fix: use public CDN URL for remote runner compatibility

- Set ROBUST_CDN_URL to https://cdn.wylab.me/ for remote runner access
- Add cache server availability probing to prevent 502 errors
- Update publish script to respect ROBUST_CDN_URL environment variable
- Fix Docker trigger dispatch API endpoint format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-16 03:11:48 +01:00
committed by Codex
parent b05226b96e
commit 9ae22ebdde
3 changed files with 34 additions and 5 deletions

View File

@@ -3,11 +3,39 @@ description: Cache NuGet packages using Gitea Actions cache server
runs:
using: composite
steps:
- name: Probe cache server
id: probe-cache
shell: bash
run: |
set -euo pipefail
url="${ACTIONS_CACHE_URL:-}"
if [ -z "$url" ]; then
echo "CACHE_AVAILABLE=false" >> "$GITHUB_ENV"
echo "No ACTIONS_CACHE_URL set; skipping cache."
exit 0
fi
python - <<'PY'
import os, socket, sys, urllib.parse
url = os.environ.get("ACTIONS_CACHE_URL", "")
parsed = urllib.parse.urlparse(url)
host, port = parsed.hostname, parsed.port or (443 if parsed.scheme == "https" else 80)
ok = False
try:
with socket.create_connection((host, port), timeout=2):
ok = True
except OSError:
ok = False
print(f"probe {host}:{port} ok={ok}")
with open(os.environ["GITHUB_ENV"], "a") as f:
f.write(f"CACHE_AVAILABLE={'true' if ok else 'false'}\n")
PY
- name: Cache NuGet packages
uses: actions/cache@v3
uses: actions/cache@v4
if: env.CACHE_AVAILABLE == 'true'
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-nuget-
${{ runner.os }}-nuget-

View File

@@ -122,6 +122,7 @@ PY
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
GITHUB_REPOSITORY: wylab/wylab-station-14
FORK_ID: wylab
ROBUST_CDN_URL: https://cdn.wylab.me/
if: ${{ steps.cdn-check.outputs.skip != 'true' }}
- name: Trigger Docker image rebuild
@@ -138,8 +139,8 @@ PY
curl -sSL -X POST \
-H "Authorization: token ${DISPATCH_TOKEN}" \
-H "Content-Type: application/json" \
https://git.wylab.me/api/v1/repos/${TARGET_REPO}/dispatches \
-d "{\"event_type\":\"ss14-package-ready\",\"client_payload\":{\"commit\":\"${PAYLOAD}\"}}"
https://git.wylab.me/api/v1/repos/${TARGET_REPO}/actions/workflows/main.yml/dispatches \
-d "{\"ref\":\"main\",\"inputs\":{\"commit\":\"${PAYLOAD}\"}}"
# - name: Publish changelog (Discord)
# continue-on-error: true

View File

@@ -16,7 +16,7 @@ RELEASE_DIR = "release"
# CONFIGURATION PARAMETERS
# Forks should change these to publish to their own infrastructure.
#
ROBUST_CDN_URL = "https://cdn.wylab.me/"
ROBUST_CDN_URL = os.environ.get("ROBUST_CDN_URL", "https://cdn.wylab.me/")
def main():
parser = argparse.ArgumentParser()