chore: remove remaining references to AppVeyor (#45339)

This commit is contained in:
David Sanders 2025-02-07 03:57:36 -08:00 committed by GitHub
parent 7bde100a1a
commit 4512b2b5c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 5 additions and 407 deletions

View file

@ -1,5 +1,4 @@
# These env vars are only necessary for creating Electron releases.
# See docs/development/releasing.md
APPVEYOR_CLOUD_TOKEN=
ELECTRON_GITHUB_TOKEN=

4
.github/CODEOWNERS vendored
View file

@ -8,13 +8,9 @@
DEPS @electron/wg-upgrades
# Releases WG
/.github/workflows/update_appveyor_image.yml @electron/wg-releases
/docs/breaking-changes.md @electron/wg-releases
/npm/ @electron/wg-releases
/script/release @electron/wg-releases
appveyor.yml @electron/wg-releases
appveyor-bake.yml @electron/wg-releases
appveyor-woa.yml @electron/wg-releases
# Security WG
/lib/browser/devtools.ts @electron/wg-security

View file

@ -1,78 +0,0 @@
name: Update AppVeyor Image
# Run chron daily Mon-Fri
on:
workflow_dispatch:
schedule:
- cron: '0 8 * * 1-5' # runs 8:00 every business day (see https://crontab.guru)
permissions: {}
jobs:
bake-appveyor-image:
name: Bake AppVeyor Image
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
uses: electron/github-app-auth-action@384fd19694fe7b6dcc9a684746c6976ad78228ae # v1.1.1
id: generate-token
with:
creds: ${{ secrets.APPVEYOR_UPDATER_GH_APP_CREDS }}
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
token: ${{ steps.generate-token.outputs.token }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20.11.x
- name: Yarn install
run: |
node script/yarn.js install --frozen-lockfile
- name: Set Repo for Commit
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Check AppVeyor Image
env:
APPVEYOR_TOKEN: ${{ secrets.APPVEYOR_TOKEN }}
run: |
node ./script/prepare-appveyor
if [ -f ./image_version.txt ]; then
echo "APPVEYOR_IMAGE_VERSION="$(cat image_version.txt)"" >> $GITHUB_ENV
rm image_version.txt
fi
- name: (Optionally) Update Appveyor Image
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
uses: mikefarah/yq@8bf425b4d1344db7cd469a8d10a390876e0c77fd # v4.45.1
with:
cmd: |
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor-woa.yml" > "appveyor-woa2.yml"
- name: (Optionally) Generate Commit Diff
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
run: |
diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true
patch -f appveyor.yml < appveyor.diff
rm appveyor2.yml appveyor.diff
git add appveyor.yml
- name: (Optionally) Generate Commit Diff for WOA
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
run: |
diff -w -B appveyor-woa.yml appveyor-woa2.yml > appveyor-woa.diff || true
patch -f appveyor-woa.yml < appveyor-woa.diff
rm appveyor-woa2.yml appveyor-woa.diff
git add appveyor-woa.yml
- name: (Optionally) Commit to Branch
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
uses: dsanders11/github-app-commit-action@43de6da2f4d927e997c0784c7a0b61bd19ad6aac # v1.5.0
with:
message: 'build: update appveyor image to latest version'
ref: bump-appveyor-image
token: ${{ steps.generate-token.outputs.token }}
- name: (Optionally) Create Pull Request
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
run: |
printf "This PR updates appveyor.yml to the latest baked image, ${{ env.APPVEYOR_IMAGE_VERSION }}.\n\nNotes: none" | gh pr create --head bump-appveyor-image --label no-backport --label semver/none --title 'build: update appveyor image to latest version' --body-file=-
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

View file

@ -1,7 +1,6 @@
[![Electron Logo](https://electronjs.org/images/electron-logo.svg)](https://electronjs.org)
[![GitHub Actions Build Status](https://github.com/electron/electron/actions/workflows/build.yml/badge.svg)](https://github.com/electron/electron/actions/workflows/build.yml)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/4lggi9dpjc1qob7k/branch/main?svg=true)](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
[![Electron Discord Invite](https://img.shields.io/discord/745037351163527189?color=%237289DA&label=chat&logo=discord&logoColor=white)](https://discord.gg/electronjs)
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.

View file

@ -1,227 +0,0 @@
const { Octokit } = require('@octokit/rest');
const got = require('got');
const assert = require('node:assert');
const fs = require('node:fs');
const path = require('node:path');
const { handleGitCall, ELECTRON_DIR } = require('./lib/utils.js');
const octokit = new Octokit();
const APPVEYOR_IMAGES_URL = 'https://ci.appveyor.com/api/build-clouds';
const APPVEYOR_JOB_URL = 'https://ci.appveyor.com/api/builds';
const ROLLER_BRANCH_PATTERN = /^roller\/chromium$/;
const DEFAULT_BUILD_CLOUD_ID = '1598';
const DEFAULT_BUILD_CLOUD = 'electronhq-16-core';
const DEFAULT_BAKE_BASE_IMAGE = 'base-bake-image';
const DEFAULT_BUILD_IMAGE = 'base-bake-image';
const appveyorBakeJob = 'electron-bake-image';
const appVeyorJobs = {
'electron-x64': 'electron-x64-testing',
'electron-woa': 'electron-woa-testing',
'electron-ia32': 'electron-ia32-testing'
};
async function makeRequest ({ auth, username, password, url, headers, body, method }) {
const clonedHeaders = {
...(headers || {})
};
if (auth?.bearer) {
clonedHeaders.Authorization = `Bearer ${auth.bearer}`;
}
const options = {
headers: clonedHeaders,
body,
method
};
if (username || password) {
options.username = username;
options.password = password;
}
const response = await got(url, options);
if (response.statusCode < 200 || response.statusCode >= 300) {
console.error('Error: ', `(status ${response.statusCode})`, response.body);
throw new Error(`Unexpected status code ${response.statusCode} from ${url}`);
}
return JSON.parse(response.body);
}
async function checkAppVeyorImage (options) {
const IMAGE_URL = `${APPVEYOR_IMAGES_URL}/${options.cloudId}`;
const requestOpts = {
url: IMAGE_URL,
auth: {
bearer: process.env.APPVEYOR_TOKEN
},
headers: {
'Content-Type': 'application/json'
},
method: 'GET'
};
try {
const { settings } = await makeRequest(requestOpts);
const { cloudSettings } = settings;
return cloudSettings.images.find(image => image.name === `${options.imageVersion}`) || null;
} catch (err) {
if (err.response?.body) {
console.error('Could not call AppVeyor: ', {
statusCode: err.response.statusCode,
body: JSON.parse(err.response.body)
});
} else {
console.error('Error calling AppVeyor:', err);
}
}
}
async function getPullRequestId (targetBranch) {
const prsForBranch = await octokit.pulls.list({
owner: 'electron',
repo: 'electron',
state: 'open',
head: `electron:${targetBranch}`
});
if (prsForBranch.data.length === 1) {
return prsForBranch.data[0].number;
} else {
return null;
}
}
function useAppVeyorImage (targetBranch, options) {
const validJobs = Object.keys(appVeyorJobs);
if (options.job) {
assert(validJobs.includes(options.job), `Unknown AppVeyor CI job name: ${options.job}. Valid values are: ${validJobs}.`);
callAppVeyorBuildJobs(targetBranch, options.job, options);
} else {
for (const job of validJobs) {
callAppVeyorBuildJobs(targetBranch, job, options);
}
}
}
async function callAppVeyorBuildJobs (targetBranch, job, options) {
console.log(`Using AppVeyor image ${options.version} for ${job}`);
const pullRequestId = await getPullRequestId(targetBranch);
const environmentVariables = {
APPVEYOR_BUILD_WORKER_CLOUD: DEFAULT_BUILD_CLOUD,
APPVEYOR_BUILD_WORKER_IMAGE: options.version,
ELECTRON_OUT_DIR: 'Default',
ELECTRON_ENABLE_STACK_DUMPING: 1,
ELECTRON_ALSO_LOG_TO_STDERR: 1,
DEPOT_TOOLS_WIN_TOOLCHAIN: 0,
PYTHONIOENCODING: 'UTF-8'
};
const requestOpts = {
url: APPVEYOR_JOB_URL,
auth: {
bearer: process.env.APPVEYOR_TOKEN
},
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountName: 'electron-bot',
projectSlug: appVeyorJobs[job],
branch: targetBranch,
pullRequestId: pullRequestId || undefined,
commitId: options.commit || undefined,
environmentVariables
}),
method: 'POST'
};
try {
const { version } = await makeRequest(requestOpts);
const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${version}`;
console.log(`AppVeyor CI request for ${job} successful. Check status at ${buildUrl}`);
} catch (err) {
console.log('Could not call AppVeyor: ', err);
}
}
async function bakeAppVeyorImage (targetBranch, options) {
console.log(`Baking a new AppVeyor image for ${options.version}, on build cloud ${options.cloudId}`);
const environmentVariables = {
APPVEYOR_BUILD_WORKER_CLOUD: DEFAULT_BUILD_CLOUD,
APPVEYOR_BUILD_WORKER_IMAGE: DEFAULT_BAKE_BASE_IMAGE,
APPVEYOR_BAKE_IMAGE: options.version
};
const requestOpts = {
url: APPVEYOR_JOB_URL,
auth: {
bearer: process.env.APPVEYOR_TOKEN
},
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountName: 'electron-bot',
projectSlug: appveyorBakeJob,
branch: targetBranch,
commitId: options.commit || undefined,
environmentVariables
}),
method: 'POST'
};
try {
const { version } = await makeRequest(requestOpts);
const bakeUrl = `https://ci.appveyor.com/project/electron-bot/${appveyorBakeJob}/build/${version}`;
console.log(`AppVeyor image bake request for ${options.version} successful. Check bake status at ${bakeUrl}`);
} catch (err) {
console.log('Could not call AppVeyor: ', err);
}
}
async function prepareAppVeyorImage (opts) {
const branch = await handleGitCall(['rev-parse', '--abbrev-ref', 'HEAD'], ELECTRON_DIR);
if (ROLLER_BRANCH_PATTERN.test(branch)) {
useAppVeyorImage(branch, { ...opts, version: DEFAULT_BUILD_IMAGE, cloudId: DEFAULT_BUILD_CLOUD_ID });
} else {
const versionRegex = /chromium_version':\n +'(.+?)',/m;
const deps = fs.readFileSync(path.resolve(__dirname, '..', 'DEPS'), 'utf8');
const [, CHROMIUM_VERSION] = versionRegex.exec(deps);
const cloudId = opts.cloudId || DEFAULT_BUILD_CLOUD_ID;
const imageVersion = opts.imageVersion || `e-${CHROMIUM_VERSION}`;
const image = await checkAppVeyorImage({ cloudId, imageVersion });
if (image && image.name) {
console.log(`Image exists for ${image.name}. Continuing AppVeyor jobs using ${cloudId}.\n`);
} else {
console.log(`No AppVeyor image found for ${imageVersion} in ${cloudId}.
Creating new image for ${imageVersion}, using Chromium ${CHROMIUM_VERSION} - job will run after image is baked.`);
await bakeAppVeyorImage(branch, { ...opts, version: imageVersion, cloudId });
// write image to temp file if running on CI
if (process.env.CI) fs.writeFileSync('./image_version.txt', imageVersion);
}
}
}
module.exports = prepareAppVeyorImage;
// Load or bake AppVeyor images for Windows CI.
// Usage: prepare-appveyor.js [--cloudId=CLOUD_ID] [--appveyorJobId=xxx] [--imageVersion=xxx]
// [--commit=sha] [--branch=branch_name]
if (require.main === module) {
const args = require('minimist')(process.argv.slice(2));
prepareAppVeyorImage(args)
.catch((err) => {
console.error(err);
process.exit(1);
});
}

View file

@ -30,14 +30,11 @@ This script just outputs the theoretical "next" version that a release would use
This script creates all the requisite tags and CI builds that will populate required release assets.
* Creates the git tag
* Kicks off all release builds on AppVeyor and GitHub Actions
* Kicks off all release builds on GitHub Actions
### `run-release-build`
This script is used to re-kick specific release builds after they fail. Sudowoodo is responsible for prompting the release team as to whether or not to run this script. It's currently only used for AppVeyor builds.
> [!IMPORTANT]
> This script should be removed and the "rerun" logic for AppVeyor be implemented in Sudowoodo specifically in the same way that GitHub Actions' rerun logic is.
This script is used to re-kick specific release builds after they fail. Sudowoodo is responsible for prompting the release team as to whether or not to run this script.
### `validate-before-publish`

View file

@ -27,7 +27,7 @@ const targetBranch = positionals[0];
if (positionals.length < 1) {
console.log(`Trigger CI to build release builds of electron.
Usage: ci-release-build.js [--job=CI_JOB_NAME] [--arch=INDIVIDUAL_ARCH] [--ci=AppVeyor|GitHubActions]
Usage: ci-release-build.js [--job=CI_JOB_NAME] [--arch=INDIVIDUAL_ARCH] [--ci=GitHubActions]
[--ghRelease] [--commit=sha] [--newVersion=version_tag] TARGET_BRANCH
`);
process.exit(0);

View file

@ -1,80 +0,0 @@
REM Parameters vs_buildtools.exe download link and wsdk version
@ECHO OFF
SET wsdk=11SDK.22621
REM Check for disk space
Rem 543210987654321
Set "Blank= "
Set "GB100= 107374182400"
for /f "tokens=2" %%A in (
'wmic LogicalDisk Get DeviceID^,FreeSpace ^| find /i "C:"'
) Do Set "FreeSpace=%Blank%%%A"
Set "FreeSpace=%FreeSpace:~-15%"
Echo FreeSpace="%FreeSpace%"
Echo 100 GB="%GB100%"
If "%FreeSpace%" gtr "%GB100%" (
Echo yes enough free space
) else (
Echo not enough free space - 100GB
exit 5
)
REM Interpret arguments
:loop
IF NOT "%1"=="" (
IF "%1"=="-buildtools_link" (
SET buildtools_link=%2
SHIFT
)
IF "%1"=="-wsdk" (
SET wsdk=%2
SHIFT
)
SHIFT
GOTO :loop
)
@ECHO ON
if not exist "C:\TEMP\" mkdir C:\TEMP
REM Install chocolatey to further install dependencies
set chocolateyUseWindowsCompression='true'
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" ^
-NoProfile -InputFormat None -ExecutionPolicy Bypass ^
-Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
REM Install Visual Studio Toolchain
choco install visualstudio2022buildtools --package-parameters "--quiet --wait --norestart --nocache --installPath ""%ProgramFiles%/Microsoft Visual Studio/2022/Community"" --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.MFC.ARM64 --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.Windows%wsdk% --includeRecommended"
REM Install Windows SDK
choco install windows-sdk-11-version-22h2-all
REM Install nodejs python git and yarn needed dependencies
choco install -y --force nodejs --version=20.17.0
choco install -y python2 git yarn
choco install python --version 3.7.9
call C:\ProgramData\chocolatey\bin\RefreshEnv.cmd
SET PATH=C:\Python27\;C:\Python27\Scripts;C:\Python39\;C:\Python39\Scripts;%PATH%
if exist "C:\Users\appveyor\AppData\Roaming\npm" (
rm -rf "C:\Users\appveyor\AppData\Roaming\npm"
mkdir "C:\Users\appveyor\AppData\Roaming\npm"
)
if not exist "C:\Users\appveyor\AppData\Roaming\npm" (
mkdir "C:\Users\appveyor\AppData\Roaming\npm"
)
REM Setup Depot Tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git C:\depot_tools
SET PATH=%PATH%;C:\depot_tools\
REM Add symstore to PATH permanently
setx path "%%path%%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64"
REM Add vs2022_install to environment variables
SET vs2022_install="C:\Program Files\Microsoft Visual Studio\2022\Community"

View file

@ -21,7 +21,7 @@ function isTestingBindingAvailable () {
// This test depends on functions that are only available when DCHECK_IS_ON.
ifdescribe(isTestingBindingAvailable())('logging', () => {
it('does not log by default', async () => {
// ELECTRON_ENABLE_LOGGING is turned on in the appveyor config.
// ELECTRON_ENABLE_LOGGING might be set in the environment, so remove it
const { ELECTRON_ENABLE_LOGGING: _, ...envWithoutEnableLogging } = process.env;
const rc = await startRemoteControlApp([], { env: envWithoutEnableLogging });
const stderrComplete = new Promise<string>(resolve => {

View file

@ -26,7 +26,6 @@
"@electron-ci/external-ab": "file:./fixtures/native-addon/external-ab/",
"@electron/fuses": "^1.8.0",
"@electron/packager": "^18.3.2",
"@marshallofsound/mocha-appveyor-reporter": "^0.4.3",
"@types/sinon": "^9.0.4",
"@types/ws": "^7.2.0",
"basic-auth": "^2.0.1",

View file

@ -144,13 +144,6 @@
semver "^7.3.5"
tar "^6.1.11"
"@marshallofsound/mocha-appveyor-reporter@^0.4.3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@marshallofsound/mocha-appveyor-reporter/-/mocha-appveyor-reporter-0.4.3.tgz#a9225224391a90e3c6bb48415d5015de895a7114"
integrity sha512-uKMY+VTNWQRcMr9P7ErRqi0TKAC6oceFs2Y6MDdXqDNxOU4AQYQ6WNrH8LuCQFeV9Y/vMU7wFJvD7oQeWsQzWQ==
dependencies:
got "^11.8.6"
"@nornagon/put@0.0.8":
version "0.0.8"
resolved "https://registry.yarnpkg.com/@nornagon/put/-/put-0.0.8.tgz#9d497ec46c9364acc3f8b59aa3cf8ee4134ae337"
@ -1361,7 +1354,7 @@ gopd@^1.0.1:
dependencies:
get-intrinsic "^1.1.3"
got@^11.8.5, got@^11.8.6:
got@^11.8.5:
version "11.8.6"
resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a"
integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==