From c37fe8f9e0ce80c1fdc3965df97e1935fef8796e Mon Sep 17 00:00:00 2001 From: bincxz <16399091+binaricat@users.noreply.github.com> Date: Mon, 23 Mar 2026 16:44:52 +0800 Subject: [PATCH] ci: verify and recover update metadata after artifact merge download-artifact@v4 merge-multiple can silently drop files when multiple artifacts contain same-named files (builder-debug.yml). This caused latest-mac.yml to be missing from v1.0.64 release. Add a verification step that checks all platform update yml files exist after merge. If any are missing, re-downloads individual artifacts to recover them. Fails the release if recovery fails. Fixes #456 Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cf6d6051..8a33b23b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -243,6 +243,40 @@ jobs: - name: List artifacts run: ls -la artifacts/ + - name: Verify update metadata files + run: | + missing=0 + for f in latest-mac.yml latest.yml latest-linux.yml latest-linux-arm64.yml; do + if [ ! -f "artifacts/$f" ]; then + echo "::warning::Missing $f in merged artifacts, attempting recovery..." + missing=1 + fi + done + if [ "$missing" = "1" ]; then + echo "Re-downloading individual artifacts to recover missing files..." + for name in netcatty-macos netcatty-windows netcatty-linux-x64 netcatty-linux-arm64; do + tmpdir="/tmp/artifact-${name}" + gh run download ${{ github.run_id }} --name "${name}" --dir "${tmpdir}" 2>/dev/null || true + if [ -d "${tmpdir}" ]; then + for yml in "${tmpdir}"/latest*.yml; do + [ -f "$yml" ] && cp -v "$yml" artifacts/ + done + fi + done + echo "After recovery:" + ls -la artifacts/*.yml + fi + # Final check — fail if any update yml is still missing + for f in latest-mac.yml latest.yml latest-linux.yml latest-linux-arm64.yml; do + if [ ! -f "artifacts/$f" ]; then + echo "::error::$f is still missing after recovery attempt" + exit 1 + fi + done + echo "All update metadata files present." + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Verify downloaded Linux amd64 deb artifact run: | deb_file="$(find artifacts -maxdepth 1 -type f -name '*-linux-amd64.deb' -print | sort | head -n 1)"