From e2f99218e0d7529856789e36ba23e08dca2b76b2 Mon Sep 17 00:00:00 2001 From: yunyingk Date: Wed, 2 Sep 2026 16:10:08 +0800 Subject: [PATCH] refactor(release): decouple gitea sync into independent job with supreme priority for darwin-arm64 archive --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 969d40a..e8958cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,8 +19,8 @@ permissions: contents: write jobs: - build-and-publish: - name: 🚀 Build & Publish Multi-Platform Binaries + build-and-publish-github: + name: 🚀 Build & Publish GitHub Release runs-on: ubuntu-latest steps: - name: Checkout @@ -73,8 +73,31 @@ jobs: fi gh release upload "${TAG_NAME}" dist/bin/seal-use-* dist/bin/checksums.txt --repo "${GITHUB_REPOSITORY}" --clobber - - name: Publish Gitea Release - continue-on-error: true + - name: Upload binaries artifact + uses: actions/upload-artifact@v4 + with: + name: release-binaries + path: dist/bin/ + retention-days: 1 + + publish-gitea: + name: 📦 Sync Gitea Mirror + needs: build-and-publish-github + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download binaries artifact + uses: actions/download-artifact@v4 + with: + name: release-binaries + path: dist/bin/ + + - name: Sync to Gitea Release env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_HOST: "https://git.ying-qing.cn" @@ -105,17 +128,21 @@ jobs: exit 0 fi - # Tier 1: Compressed archives & checksums (Fast & high value, ~140MB total) - archive_files=( + # Tier 1: Supreme Priority (Mac Apple Silicon compressed archive & checksums, ~26MB) + supreme_files=( "dist/bin/seal-use-darwin-arm64.tar.gz" + "dist/bin/checksums.txt" + ) + + # Tier 2: Secondary Priority (Other platforms compressed archives, ~110MB) + secondary_archive_files=( "dist/bin/seal-use-darwin-x64.tar.gz" "dist/bin/seal-use-linux-arm64.tar.gz" "dist/bin/seal-use-linux-x64.tar.gz" "dist/bin/seal-use-windows-x64.zip" - "dist/bin/checksums.txt" ) - # Tier 2: Raw uncompressed executables (Large, ~360MB total) + # Tier 3: Tertiary Priority (Raw uncompressed executables, ~360MB) raw_binary_files=( "dist/bin/seal-use-darwin-arm64" "dist/bin/seal-use-darwin-x64" @@ -195,14 +222,21 @@ jobs: return 0 } - echo "==> Step 1: Uploading core compressed archives & checksums..." - for file in "${archive_files[@]}"; do + echo "==> Tier 1: Uploading Supreme Priority assets (Mac Apple Silicon archive & checksums)..." + for file in "${supreme_files[@]}"; do if [ -f "$file" ]; then upload_asset "$file" || true fi done - echo "==> Step 2: Uploading uncompressed standalone binaries..." + echo "==> Tier 2: Uploading Secondary Priority archives (Linux, Windows, Intel Mac)..." + for file in "${secondary_archive_files[@]}"; do + if [ -f "$file" ]; then + upload_asset "$file" || true + fi + done + + echo "==> Tier 3: Uploading Tertiary Priority uncompressed raw binaries..." for file in "${raw_binary_files[@]}"; do if [ -f "$file" ]; then upload_asset "$file" || true @@ -211,7 +245,7 @@ jobs: echo "==> Verifying Gitea release asset manifest..." final_release=$(release_json) - for file in "${archive_files[@]}" "${raw_binary_files[@]}"; do + for file in "${supreme_files[@]}" "${secondary_archive_files[@]}" "${raw_binary_files[@]}"; do filename=$(basename "$file") file_size=$(wc -c < "$file" | tr -d ' ') matching_count=$(echo "$final_release" | jq -r --arg name "$filename" --argjson size "$file_size" \