2022-11-21 15:24:26 +00:00
# The config is used to bake appveyor images, not for running CI jobs.
# The config expects the following environment variables to be set:
# - "APPVEYOR_BAKE_IMAGE" e.g. 'electron-99.0.4767.0'. Name of the image to be baked.
# Typically named after the Chromium version on which the image is built.
# This can be set dynamically in the prepare-appveyor script.
version : 1.0 .{build}
build_cloud : electronhq-16-core
2023-11-01 20:19:59 +00:00
image : base-bake-image
2022-11-21 15:24:26 +00:00
environment :
GIT_CACHE_PATH : C:\Users\appveyor\libcc_cache
ELECTRON_OUT_DIR : Default
ELECTRON_ENABLE_STACK_DUMPING : 1
MOCHA_REPORTER : mocha-multi-reporters
MOCHA_MULTI_REPORTERS : mocha-appveyor-reporter, tap
DEPOT_TOOLS_WIN_TOOLCHAIN : 0
PYTHONIOENCODING : UTF-8
2023-02-11 18:28:28 +00:00
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# init:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# - appveyor version
# - ps: $ErrorActionPreference = 'Stop'
# - ps: 'Write-Host "OS Build: $((Get-CimInstance Win32_OperatingSystem).BuildNumber)"'
# clone_folder: '%USERPROFILE%\image-bake-scripts'
# clone_script:
# - ps: Invoke-WebRequest "https://github.com/appveyor/build-images/archive/1f90d94e74c8243c909a09b994e527584dfcb838.zip" -OutFile "$env:temp\scripts.zip"
# - ps: Expand-Archive -Path "$env:temp\scripts.zip" -DestinationPath "$env:temp\scripts" -Force
# - ps: Copy-Item -Path "$env:temp\scripts\build-images-1f90d94e74c8243c909a09b994e527584dfcb838\scripts\Windows\*" -Destination $env:APPVEYOR_BUILD_FOLDER -Recurse
2022-11-21 15:24:26 +00:00
build_script :
2023-02-11 18:28:28 +00:00
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# - ps: .\init_server.ps1
# - ps: .\extend_system_volume.ps1
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# - appveyor version
# - ps: .\install_path_utils.ps1
# - ps: .\install_powershell_core.ps1
# - ps: .\install_powershell_get.ps1
# - ps: .\install_7zip.ps1
# - ps: .\install_chocolatey.ps1
# - ps: .\install_webpi.ps1
# - ps: .\install_nuget.ps1
# - ps: .\install_pstools.ps1
# - ps: .\install_git.ps1
# - ps: .\install_git_lfs.ps1
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
# END LINES FOR COMPLETELY NEW IMAGE
2022-11-21 15:24:26 +00:00
- git config --global core.longpaths true
2022-12-13 19:28:09 +00:00
- ps : >-
2023-02-11 18:28:28 +00:00
if (-not (Test-Path -Path C:\projects\src)) {
New-Item -Path C:\projects\src -ItemType Directory
2022-12-13 19:28:09 +00:00
}
2023-02-11 18:28:28 +00:00
- cd C:\projects\
- git clone -q --branch=%APPVEYOR_REPO_BRANCH% https://github.com/electron/electron.git C:\projects\src\electron
- git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
2023-02-01 11:59:16 +00:00
- ps : $env:PATH="$pwd\depot_tools;$env:PATH"
2022-11-21 15:24:26 +00:00
- update_depot_tools.bat
2022-12-13 19:28:09 +00:00
# Uncomment the following line if windows deps change
# - src\electron\script\setup-win-for-dev.bat
2022-11-21 15:24:26 +00:00
- >-
gclient config
--name "src\electron"
--unmanaged
%GCLIENT_EXTRA_ARGS%
"https://github.com/electron/electron"
- ps : cd src\electron
- ps : node script\generate-deps-hash.js
- ps : $depshash = Get-Content .\.depshash -Raw
- ps : Copy-Item -path .\.depshash -destination ..\.depshash
- ps : cd ..\..
- gclient sync --with_branch_heads --with_tags --nohooks
2023-03-10 16:07:42 +00:00
- ps : regsvr32 /s "C:\Program Files\Microsoft Visual Studio\2022\Community\DIA SDK\bin\amd64\msdia140.dll"
- ps : set vs2022_install="C:\Program Files\Microsoft Visual Studio\2022\Community"
2022-12-13 19:28:09 +00:00
2023-02-11 18:28:28 +00:00
# The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
# # Restart VM
# - ps: Start-Sleep -s 5; Restart-Computer
# - ps: Start-Sleep -s 5
2022-12-13 19:28:09 +00:00
2023-02-11 18:28:28 +00:00
# - cd %USERPROFILE%\image-bake-scripts
# - appveyor version
# - ps: .\optimize_dotnet_runtime.ps1
# - ps: .\disable_windows_background_services.ps1
# - ps: .\enforce_windows_firewall.ps1
# - ps: .\cleanup_windows.ps1
# END LINES FOR COMPLETELY NEW IMAGE
2022-11-21 15:24:26 +00:00
on_image_bake :
- ps : >-
echo "Baking image: $env:APPVEYOR_BAKE_IMAGE at dir $PWD"
2023-02-11 18:28:28 +00:00
- ps : Remove-Item -Recurse -Force C:\projects\depot_tools
- ps : Remove-Item -Recurse -Force C:\projects\src\electron
2022-12-13 19:28:09 +00:00
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP after bake is done
2023-02-11 18:28:28 +00:00
# # on_finish:
# - ps: >-
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))