build: add release config/dsymutil fix, test-releases for GHA (#42350)

* build: add publishing workflow for GHActions

* build: add test repo/bucket for uploads

* build: clean up conditionals, add macos-14-large, review comments

* build: remove host_cpu var from GCLIENT_EXTRA_ARGS

* build: use GN_CONFIG

* remove: hardcode release gn config

* Fix GN args import for release

* Use BUILD_TOOLS_SHA when cloning build-tools in test

* build: create test release in prepare-release

* build: fix GN_CONFIG for mas builds

* Fix dsymutil arch resetting

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Keeley Hammond 2024-06-03 11:43:54 -07:00 коммит произвёл GitHub
Родитель 361b37592a
Коммит 5f8a490a00
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 54 добавлений и 7 удалений

25
.github/workflows/config/release/evm.mas.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,25 @@
{
"root": "/Users/runner/work/electron/electron/",
"remotes": {
"electron": {
"origin": "https://github.com/electron/electron.git"
}
},
"gen": {
"args": [
"import(\"//electron/build/args/release.gn\")",
"use_remoteexec = true",
"is_mas_build = true"
],
"out": "Default"
},
"env": {
"CHROMIUM_BUILDTOOLS_PATH": "/Users/runner/work/electron/electron/src/buildtools",
"GIT_CACHE_PATH": "/Users/runner/work/electron/electron/.git-cache"
},
"$schema": "file:///home/builduser/.electron_build_tools/evm-config.schema.json",
"configValidationLevel": "strict",
"reclient": "remote_exec",
"goma": "none",
"preserveXcode": 5
}

Просмотреть файл

19
.github/workflows/macos-build.yml поставляемый
Просмотреть файл

@ -16,7 +16,7 @@ on:
GN_BUILD_TYPE:
required: false
type: string
default: testing
default: release
GENERATE_SYMBOLS:
required: false
type: boolean
@ -36,6 +36,7 @@ env:
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
AZURE_STORAGE_CONTAINER_NAME: ${{ secrets.AZURE_STORAGE_CONTAINER_NAME }}
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
GN_CONFIG: ${{ inputs.GN_CONFIG }}
# Disable pre-compiled headers to reduce out size - only useful for rebuilds
GN_BUILDFLAG_ARGS: 'enable_precompiled_headers = false'
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
@ -200,7 +201,8 @@ jobs:
run: |
export BUILD_TOOLS_SHA=2bb63e2e7877491b52f972532b52adc979a6ec2f
npm i -g @electron/build-tools
e init --root=$(pwd) --out=Default ${{ inputs.GN_BUILD_TYPE }}
e init --root=$(pwd) --out=Default ${{ inputs.GN_BUILD_TYPE }} --import ${{ inputs.GN_BUILD_TYPE }}
e use ${{ inputs.GN_BUILD_TYPE }}
- name: Checkout Electron
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
with:
@ -335,7 +337,11 @@ jobs:
cipd ensure --root src/buildtools/reclient -ensure-file gn_ensure_file
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
if [ "$TARGET_ARCH" == "arm64" ]; then
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
else
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
fi
python3 src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang -s $DSYM_SHA_FILE -o src/tools/clang/dsymutil/bin/dsymutil
echo 'infra/3pp/tools/ninja/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/third_party/ninja:infra/3pp/tools/ninja/${platform}'` > ninja_ensure_file
@ -454,9 +460,9 @@ jobs:
# TODO(codebytere): remove this once we figure out why .git/packed-refs is initially missing
git pack-refs
cd ..
ulimit -n 10000
sudo launchctl limit maxfiles 65536 200000
NINJA_SUMMARIZE_BUILD=1 e build -j $NUMBER_OF_NINJA_PROCESSES
cp out/Default/.ninja_log out/electron_ninja_log
node electron/script/check-symlinks.js
@ -548,7 +554,7 @@ jobs:
key: ${{ runner.os }}-build-artifacts-darwin-${{ env.TARGET_ARCH }}-${{ github.sha }}
- name: Create MAS Config
run: |
mv src/electron/.github/workflows/config/evm.mas.json $HOME/.electron_build_tools/configs/evm.mas.json
mv src/electron/.github/workflows/config/${{ inputs.GN_BUILD_TYPE }}/evm.mas.json $HOME/.electron_build_tools/configs/evm.mas.json
echo "MAS_BUILD=true" >> $GITHUB_ENV
e use mas
- name: Build Electron (mas)
@ -718,7 +724,8 @@ jobs:
steps:
- name: Load Build Tools
run: |
yarn add git://github.com/electron/build-tools.git#2bb63e2e7877491b52f972532b52adc979a6ec2f
export BUILD_TOOLS_SHA=2bb63e2e7877491b52f972532b52adc979a6ec2f
npm i -g @electron/build-tools
e init --root=$(pwd) --out=Default ${{ inputs.GN_BUILD_TYPE }}
- name: Checkout Electron
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b

Просмотреть файл

@ -17,7 +17,6 @@ const bumpType = args._[0];
const targetRepo = getRepo();
function getRepo () {
if (process.env.IS_GHA_RELEASE) return 'test-releases';
return bumpType === 'nightly' ? 'nightlies' : 'electron';
}
@ -128,7 +127,23 @@ async function createRelease (branchToTarget, isBeta) {
process.exit(1);
});
const ghaTestRelease = await octokit.repos.createRelease({
owner: 'electron',
repo: 'test-releases',
tag_name: newVersion,
draft: true,
name: `electron ${newVersion}`,
body: releaseBody,
prerelease: releaseIsPrelease,
target_commitish: newVersion.includes('nightly') ? 'main' : branchToTarget
}).catch(err => {
console.log(`${fail} Error creating new GHA test release: `, err);
});
console.log(`Release has been created with id: ${release.data.id}.`);
if (ghaTestRelease && ghaTestRelease.data) {
console.log(`Test Release has been created with id: ${ghaTestRelease.data.id}.`);
}
console.log(`${pass} Draft release for ${newVersion} successful.`);
}