@@ -240,6 +240,98 @@ jobs:
240240 env :
241241 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
242242
243+ # --- Test tag only: fetch existing test appcasts from gh-pages (design: two appcast feeds) ---
244+ - name : Fetch Existing Test Appcast Feeds
245+ if : ${{ contains(github.ref_name, '-test') }}
246+ run : |
247+ echo "=== Fetching Existing Test Appcast Feeds ==="
248+ mkdir -p updates/macos/test
249+ mkdir -p updates/windows/test
250+ git fetch origin gh-pages:gh-pages 2>/dev/null || echo "gh-pages branch not found, will create new test appcasts"
251+ if git show origin/gh-pages:updates/macos/test/appcast.xml > updates/macos/test/appcast.xml 2>/dev/null; then
252+ echo "[OK] Fetched existing macOS test appcast"
253+ else
254+ echo "[INFO] No existing macOS test appcast found, will create new one"
255+ rm -f updates/macos/test/appcast.xml
256+ fi
257+ if git show origin/gh-pages:updates/windows/test/appcast.xml > updates/windows/test/appcast.xml 2>/dev/null; then
258+ echo "[OK] Fetched existing Windows test appcast"
259+ else
260+ echo "[INFO] No existing Windows test appcast found, will create new one"
261+ rm -f updates/windows/test/appcast.xml
262+ fi
263+
264+ - name : Generate Test Appcast Feeds
265+ if : ${{ contains(github.ref_name, '-test') }}
266+ run : |
267+ echo "=== Generating Test Appcast Feeds ==="
268+ VERSION="${{ github.ref_name }}"
269+ REPO="${{ github.repository }}"
270+ VERSION_NUM="${VERSION#v}"
271+ echo "Version: $VERSION_NUM"
272+ DMG_FILE=$(ls artifacts/macos/*.dmg 2>/dev/null | head -1)
273+ EXE_FILE=$(ls artifacts/windows/*.exe 2>/dev/null | head -1)
274+ if [ -z "$DMG_FILE" ] || [ -z "$EXE_FILE" ]; then
275+ echo "Warning: DMG or EXE file not found, skipping test appcast generation"
276+ exit 0
277+ fi
278+ DMG_URL="https://github.com/$REPO/releases/download/$VERSION/$(basename $DMG_FILE)"
279+ EXE_URL="https://github.com/$REPO/releases/download/$VERSION/$(basename $EXE_FILE)"
280+ RELEASE_NOTES_URL="https://github.com/$REPO/releases/tag/$VERSION"
281+ if [ -f "$DMG_FILE" ]; then
282+ python scripts/generate_appcast.py \
283+ --dmg "$DMG_FILE" \
284+ --version "$VERSION_NUM" \
285+ --url "$DMG_URL" \
286+ --notes "$RELEASE_NOTES_URL" \
287+ --output updates/macos/test/appcast.xml \
288+ --append \
289+ --channel test
290+ echo "[OK] macOS test appcast generated"
291+ fi
292+ if [ -f "$EXE_FILE" ]; then
293+ python scripts/generate_update_feed.py \
294+ --exe "$EXE_FILE" \
295+ --version "$VERSION_NUM" \
296+ --url "$EXE_URL" \
297+ --notes "$RELEASE_NOTES_URL" \
298+ --output updates/windows/test/appcast.xml \
299+ --append \
300+ --channel test
301+ echo "[OK] Windows test appcast generated"
302+ fi
303+ echo "Test appcast generation complete"
304+
305+ - name : Validate Test Appcast Feeds
306+ if : ${{ contains(github.ref_name, '-test') }}
307+ run : |
308+ echo "=== Validating Test Appcast Feeds ==="
309+ if [ -f "updates/macos/test/appcast.xml" ] && [ -f "updates/windows/test/appcast.xml" ]; then
310+ python scripts/validate_feeds.py \
311+ --macos updates/macos/test/appcast.xml \
312+ --windows updates/windows/test/appcast.xml
313+ echo "[OK] Test appcast feeds validated"
314+ else
315+ echo "Warning: Test appcast files not found, skipping validation"
316+ fi
317+
318+ - name : Publish Test Appcast Feeds to GitHub Pages
319+ if : ${{ contains(github.ref_name, '-test') }}
320+ run : |
321+ echo "=== Publishing Test Appcast Feeds (no index) ==="
322+ if [ -f "updates/macos/test/appcast.xml" ] && [ -f "updates/windows/test/appcast.xml" ]; then
323+ python scripts/publish_feeds.py \
324+ updates/macos/test/appcast.xml updates/windows/test/appcast.xml \
325+ --branch gh-pages \
326+ --message "Update appcast feeds (test) for ${{ github.ref_name }}" \
327+ --github-token "${{ secrets.GITHUB_TOKEN }}"
328+ echo "[OK] Test appcast feeds published to gh-pages branch"
329+ else
330+ echo "Warning: Test appcast files not found, skipping publish"
331+ fi
332+ env :
333+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
334+
243335 - name : Fetch Existing Appcast Feeds
244336 if : ${{ !contains(github.ref_name, '-test') }}
245337 run : |
0 commit comments