From 4df7f600d8b720b789c2942866ec532abceadc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sat, 4 Apr 2026 03:40:59 -0400 Subject: [PATCH] Bypass Actions artifact quota for the snapshot build branch The native runners successfully package every requested platform, but Actions artifact upload is blocked by the repository storage quota. This workflow revision sends build outputs to a temporary draft GitHub release instead so the binaries remain downloadable for Cloudflare publication. Constraint: GitHub Actions artifact storage quota is exhausted for this repository Rejected: Continue using actions/upload-artifact | every build finished packaging and then failed on upload Confidence: medium Scope-risk: narrow Directive: This release-upload path is for the temporary snapshot branch; do not keep it on the main workflow without deciding how permanent release transport should work Tested: prior run packaged macOS, Windows x64-ia32, Windows arm64, Linux x64, and Linux arm64 before upload failure Not-tested: Draft-release upload path before rerun --- .github/workflows/build.yml | 89 +++++++++++++++++++++++++------------ 1 file changed, 60 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f94d5232..35ed4a6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ concurrency: env: PNPM_VERSION: '10.24.0' NODE_VERSION: '22' + CI_RELEASE_TAG: ci-build-${{ github.run_id }} jobs: # ───────────────────────────────────────────── @@ -69,6 +70,8 @@ jobs: name: macOS (${{ matrix.arch }}) runs-on: ${{ matrix.runner }} needs: test + permissions: + contents: write strategy: fail-fast: false matrix: @@ -105,20 +108,30 @@ jobs: APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - - uses: actions/upload-artifact@v4 - with: - name: macos-${{ matrix.arch }} - path: | - build/release/*.dmg - build/release/*.zip - build/release/*.blockmap - build/release/latest-mac.yml - if-no-files-found: error + - name: Upload release files + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release view "$CI_RELEASE_TAG" >/dev/null 2>&1 || \ + gh release create "$CI_RELEASE_TAG" \ + --draft \ + --prerelease \ + --title "CI Build $GITHUB_RUN_ID" \ + --notes "Temporary build artifact transport for Cloudflare publication." \ + --target "$GITHUB_SHA" + gh release upload "$CI_RELEASE_TAG" \ + build/release/*.dmg \ + build/release/*.zip \ + build/release/*.blockmap \ + build/release/latest-mac.yml \ + --clobber build-windows: name: Windows (${{ matrix.arch }}) runs-on: windows-latest needs: test + permissions: + contents: write strategy: fail-fast: false matrix: @@ -144,19 +157,30 @@ jobs: env: CSC_LINK: ${{ secrets.WIN_CERTIFICATE_P12_BASE64 }} CSC_KEY_PASSWORD: ${{ secrets.WIN_CERTIFICATE_PASSWORD }} - - uses: actions/upload-artifact@v4 - with: - name: windows-${{ matrix.arch }} - path: | - build/release/*.exe - build/release/*.blockmap - build/release/latest.yml - if-no-files-found: error + - name: Upload release files + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release view "$CI_RELEASE_TAG" >/dev/null 2>&1 || \ + gh release create "$CI_RELEASE_TAG" \ + --draft \ + --prerelease \ + --title "CI Build $GITHUB_RUN_ID" \ + --notes "Temporary build artifact transport for Cloudflare publication." \ + --target "$GITHUB_SHA" + gh release upload "$CI_RELEASE_TAG" \ + build/release/*.exe \ + build/release/*.blockmap \ + build/release/latest.yml \ + --clobber build-linux: name: Linux (${{ matrix.arch }}) runs-on: ubuntu-latest needs: test + permissions: + contents: write strategy: fail-fast: false matrix: @@ -182,20 +206,27 @@ jobs: run: pnpm exec electron-vite build - name: Package run: pnpm exec electron-builder ${{ matrix.builder_args }} --config electron-builder.yml --publish never - - uses: actions/upload-artifact@v4 - with: - name: linux-${{ matrix.arch }} - path: | - build/release/*.AppImage - build/release/*.deb - build/release/*.rpm - build/release/*.snap - build/release/*.blockmap - build/release/latest-linux.yml - if-no-files-found: warn + - name: Upload release files + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release view "$CI_RELEASE_TAG" >/dev/null 2>&1 || \ + gh release create "$CI_RELEASE_TAG" \ + --draft \ + --prerelease \ + --title "CI Build $GITHUB_RUN_ID" \ + --notes "Temporary build artifact transport for Cloudflare publication." \ + --target "$GITHUB_SHA" + gh release upload "$CI_RELEASE_TAG" \ + build/release/*.AppImage \ + build/release/*.deb \ + build/release/*.rpm \ + build/release/*.blockmap \ + build/release/latest-linux.yml \ + --clobber # ───────────────────────────────────────────── - # Stage 4: Publish to GitHub Releases + # Stage 4: Publish Release # ───────────────────────────────────────────── release: name: Publish Release