From d631333ce40637e7487ef74fc8ae1c4255bd805e Mon Sep 17 00:00:00 2001 From: MerfiDEV Date: Sun, 4 Oct 2026 01:07:00 +0300 Subject: [PATCH] ci: cache electron-builder binaries to avoid 503 on winCodeSign download --- .github/workflows/build.yml | 16 +++++++++++++--- .github/workflows/release.yml | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dce234a..354e17b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.calc.outputs.version }} - tag: ${{ steps.calc.outputs.tag }} + tag: ${{ steps.calc.outputs.tag }} steps: - uses: actions/checkout@v4 with: @@ -93,8 +93,8 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: '20' - cache: 'npm' + node-version: "20" + cache: "npm" - name: Sync version from computed tag run: node scripts/sync-version.js @@ -103,6 +103,16 @@ jobs: - run: npm install --no-fund --no-audit + # Кэш бинарников electron-builder (winCodeSign, nsis, winCodeSign и пр.). + # Защита от 503 при скачивании вспомогательных тулов с GitHub Releases. + - name: Cache electron-builder binaries + uses: actions/cache@v4 + with: + path: ${{ runner.os == 'Windows' && 'C:\\Users\\runneradmin\\AppData\\Local\\electron-builder\\Cache' || '~/.cache/electron-builder' }} + key: electron-builder-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + electron-builder-${{ runner.os }}- + - name: Build run: npm run ${{ matrix.command }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 276fee4..20048a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: "Release: Build & Publish" on: push: tags: - - 'v*' + - "v*" permissions: contents: write @@ -26,8 +26,8 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: '20' - cache: 'npm' + node-version: "20" + cache: "npm" - name: Sync version from tag run: node scripts/sync-version.js @@ -37,6 +37,16 @@ jobs: - name: Install dependencies run: npm ci + # Кэш бинарников electron-builder (winCodeSign, nsis и пр.). + # Защита от 503 при скачивании вспомогательных тулов с GitHub Releases. + - name: Cache electron-builder binaries + uses: actions/cache@v4 + with: + path: ${{ runner.os == 'Windows' && 'C:\\Users\\runneradmin\\AppData\\Local\\electron-builder\\Cache' || '~/Library/Caches/electron-builder' }} + key: electron-builder-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + electron-builder-${{ runner.os }}- + - name: Build and Publish (stable) if: ${{ !contains(github.ref_name, '-beta') }} run: npm run ${{ matrix.command }}