Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit 553543a

Browse files
VerteDindekhalwa
authored andcommitted
ci: bake appveyor images automatically, run sync on depshash change (electron#35396)
* chore: update yml formatting for parser * ci: bake appveyor images automatically, run sync on depshash change * chore: clean up .yml files * chore: bump to e-110.0.5415.0
1 parent 054c0db commit 553543a

File tree

10 files changed

+529
-288
lines changed

10 files changed

+529
-288
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Update AppVeyor Image
2+
3+
# Run chron daily Mon-Fri
4+
on:
5+
schedule:
6+
- cron: '0 8 * * 1-5' # runs 8:00 every business day (see https://crontab.guru)
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
bake-appveyor-image:
14+
name: Bake AppVeyor Image
15+
permissions:
16+
contents: write
17+
pull-requests: write # to create a new PR with updated Appveyor images
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
- name: Yarn install
25+
run: |
26+
node script/yarn.js install --frozen-lockfile
27+
- name: Set Repo for Commit
28+
run: git config --global --add safe.directory $GITHUB_WORKSPACE
29+
- name: Check AppVeyor Image
30+
env:
31+
APPVEYOR_TOKEN: ${{ secrets.APPVEYOR_TOKEN }}
32+
run: |
33+
node ./script/prepare-appveyor
34+
if [ -f ./image_version.txt ]; then
35+
echo "APPVEYOR_IMAGE_VERSION="$(cat image_version.txt)"" >> $GITHUB_ENV
36+
rm image_version.txt
37+
fi
38+
- name: (Optionally) Update Appveyor Image
39+
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
40+
uses: mikefarah/[email protected]
41+
with:
42+
cmd: yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
43+
- name: (Optionally) Generate Commit Diff
44+
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
45+
run: |
46+
diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true
47+
patch -f appveyor.yml < appveyor.diff
48+
rm appveyor2.yml appveyor.diff
49+
- name: (Optionally) Commit and Pull Request
50+
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
51+
uses: peter-evans/create-pull-request@v4
52+
with:
53+
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
54+
commit-message: 'build: update appveyor image to latest version'
55+
committer: GitHub <[email protected]>
56+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
57+
signoff: false
58+
branch: bump-appveyor-image
59+
delete-branch: true
60+
title: 'build: update appveyor image to latest version'
61+
body: |
62+
This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.

appveyor-bake.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# The config is used to bake appveyor images, not for running CI jobs.
2+
# The config expects the following environment variables to be set:
3+
# - "APPVEYOR_BAKE_IMAGE" e.g. 'electron-99.0.4767.0'. Name of the image to be baked.
4+
# Typically named after the Chromium version on which the image is built.
5+
# This can be set dynamically in the prepare-appveyor script.
6+
7+
version: 1.0.{build}
8+
build_cloud: electronhq-16-core
9+
image: Windows_Default_Appveyor
10+
environment:
11+
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
12+
ELECTRON_OUT_DIR: Default
13+
ELECTRON_ENABLE_STACK_DUMPING: 1
14+
MOCHA_REPORTER: mocha-multi-reporters
15+
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
16+
GOMA_FALLBACK_ON_AUTH_FAILURE: true
17+
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
18+
PYTHONIOENCODING: UTF-8
19+
build_script:
20+
- ps: Resize-Partition -DriveLetter C -Size (256GB) # ensure initial partition size
21+
- ps: Get-Partition -DriveLetter C
22+
- git config --global core.longpaths true
23+
- cd ..
24+
- mkdir src
25+
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
26+
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
27+
- update_depot_tools.bat
28+
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
29+
- src\electron\script\setup-win-for-dev.bat
30+
- >-
31+
gclient config
32+
--name "src\electron"
33+
--unmanaged
34+
%GCLIENT_EXTRA_ARGS%
35+
"https://github.com/electron/electron"
36+
- ps: cd src\electron
37+
- ps: node script\generate-deps-hash.js
38+
- ps: $depshash = Get-Content .\.depshash -Raw
39+
- ps: Copy-Item -path .\.depshash -destination ..\.depshash
40+
- ps: cd ..\..
41+
- gclient sync --with_branch_heads --with_tags --nohooks
42+
- ps: regsvr32 /s "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin\amd64\msdia140.dll"
43+
on_image_bake:
44+
- ps: >-
45+
echo "Baking image: $env:APPVEYOR_BAKE_IMAGE at dir $PWD"
46+
- ps: Remove-Item -Recurse -Force $pwd\depot_tools
47+
- ps: Remove-Item -Recurse -Force $pwd\src\electron
48+
# Uncomment these lines to enable RDP
49+
#on_finish:
50+
# - ps: >-
51+
# $env:APPVEYOR_RDP_PASSWORD = "electron"
52+
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

0 commit comments

Comments
 (0)