Repository: electron/electron
Pull request: build: fixup windows source cache for release

Backport of #46236

See that PR for details.


Notes: <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->none


Changed files:
filename: .github/actions/build-electron/action.yml
patch: @@ -185,7 +185,7 @@ runs:
       if: ${{ inputs.is-release == 'true' }}
       run: |
         cd src
-        e d gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true $GN_EXTRA_ARGS"
+        gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true $GN_EXTRA_ARGS"
         e build --target electron:electron_ffmpeg_zip -C ../../out/ffmpeg -j $NUMBER_OF_NINJA_PROCESSES
     - name: Generate Hunspell Dictionaries ${{ inputs.step-suffix }}
       shell: bash

filename: .github/actions/install-build-tools/action.yml
patch: @@ -19,3 +19,4 @@ runs:
         e d cipd.bat --version
         cp "C:\Python311\python.exe" "C:\Python311\python3.exe"
       fi
+      echo "$HOME/.electron_build_tools/third_party/depot_tools" >> $GITHUB_PATH

filename: .github/actions/restore-cache-azcopy/action.yml
patch: @@ -97,18 +97,28 @@ runs:
       $TEMP_DIR=New-Item -ItemType Directory -Path temp-cache
       $TEMP_DIR_PATH = $TEMP_DIR.FullName
       C:\ProgramData\Chocolatey\bin\7z.exe -y x $src_cache -o"$TEMP_DIR_PATH"
-      if (Test-Path "temp-cache\src") {
-        Write-Host "Relocating Cache"
-        Remove-Item -Recurse -Force src
-        Move-Item temp-cache\src src
 
-        Write-Host "Deleting zip file"
-        Remove-Item -Force $src_cache
-      }
-      if (-Not (Test-Path "src\third_party\blink")) {
-        Write-Host "Cache was not correctly restored - exiting"
-        exit 1
-      }
+  - name: Move Src Cache (Windows)
+    if: ${{ inputs.target-platform == 'win' }}
+    uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
+    with:
+      timeout_minutes: 30
+      max_attempts: 3
+      retry_on: error
+      shell: powershell  
+      command: |
+        if (Test-Path "temp-cache\src") {
+          Write-Host "Relocating Cache"
+          Remove-Item -Recurse -Force src
+          Move-Item temp-cache\src src
+
+          Write-Host "Deleting zip file"
+          Remove-Item -Force $src_cache
+        }
+        if (-Not (Test-Path "src\third_party\blink")) {
+          Write-Host "Cache was not correctly restored - exiting"
+          exit 1
+        }
 
-      Write-Host "Wiping Electron Directory"
-      Remove-Item -Recurse -Force src\electron
\ No newline at end of file
+        Write-Host "Wiping Electron Directory"
+        Remove-Item -Recurse -Force src\electron

filename: .github/workflows/windows-publish.yml
patch: @@ -25,7 +25,8 @@ jobs:
       image: ghcr.io/electron/build:${{ inputs.build-image-sha }}
       options: --user root --device /dev/fuse --cap-add SYS_ADMIN
       volumes:
-        - /mnt/cross-instance-cache:/mnt/cross-instance-cache
+        - /mnt/win-cache:/mnt/win-cache
+        - /var/run/sas:/var/run/sas
     env:
       GCLIENT_EXTRA_ARGS: '--custom-var=checkout_win=True'
       TARGET_OS: 'win'