Skip to content

Commit 5573603

Browse files
VerteDindecodebytere
authored andcommitted
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 <[email protected]>
1 parent 8d77b15 commit 5573603

File tree

4 files changed

+54
-7
lines changed

4 files changed

+54
-7
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"root": "/Users/runner/work/electron/electron/",
3+
"remotes": {
4+
"electron": {
5+
"origin": "https://github.com/electron/electron.git"
6+
}
7+
},
8+
"gen": {
9+
"args": [
10+
"import(\"//electron/build/args/release.gn\")",
11+
"use_remoteexec = true",
12+
"is_mas_build = true"
13+
],
14+
"out": "Default"
15+
},
16+
"env": {
17+
"CHROMIUM_BUILDTOOLS_PATH": "/Users/runner/work/electron/electron/src/buildtools",
18+
"GIT_CACHE_PATH": "/Users/runner/work/electron/electron/.git-cache"
19+
},
20+
"$schema": "file:///home/builduser/.electron_build_tools/evm-config.schema.json",
21+
"configValidationLevel": "strict",
22+
"reclient": "remote_exec",
23+
"goma": "none",
24+
"preserveXcode": 5
25+
}

.github/workflows/macos-build.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
GN_BUILD_TYPE:
1717
required: false
1818
type: string
19-
default: testing
19+
default: release
2020
GENERATE_SYMBOLS:
2121
required: false
2222
type: boolean
@@ -36,6 +36,7 @@ env:
3636
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
3737
AZURE_STORAGE_CONTAINER_NAME: ${{ secrets.AZURE_STORAGE_CONTAINER_NAME }}
3838
ELECTRON_RBE_JWT: ${{ secrets.ELECTRON_RBE_JWT }}
39+
GN_CONFIG: ${{ inputs.GN_CONFIG }}
3940
# Disable pre-compiled headers to reduce out size - only useful for rebuilds
4041
GN_BUILDFLAG_ARGS: 'enable_precompiled_headers = false'
4142
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_mac=True --custom-var=host_os=mac'
@@ -200,7 +201,8 @@ jobs:
200201
run: |
201202
export BUILD_TOOLS_SHA=2bb63e2e7877491b52f972532b52adc979a6ec2f
202203
npm i -g @electron/build-tools
203-
e init --root=$(pwd) --out=Default ${{ inputs.GN_BUILD_TYPE }}
204+
e init --root=$(pwd) --out=Default ${{ inputs.GN_BUILD_TYPE }} --import ${{ inputs.GN_BUILD_TYPE }}
205+
e use ${{ inputs.GN_BUILD_TYPE }}
204206
- name: Checkout Electron
205207
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
206208
with:
@@ -335,7 +337,11 @@ jobs:
335337
cipd ensure --root src/buildtools/reclient -ensure-file gn_ensure_file
336338
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
337339
338-
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
340+
if [ "$TARGET_ARCH" == "arm64" ]; then
341+
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
342+
else
343+
DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.x64.sha1
344+
fi
339345
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
340346
341347
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:
454460
# TODO(codebytere): remove this once we figure out why .git/packed-refs is initially missing
455461
git pack-refs
456462
cd ..
457-
458463
ulimit -n 10000
459464
sudo launchctl limit maxfiles 65536 200000
465+
460466
NINJA_SUMMARIZE_BUILD=1 e build -j $NUMBER_OF_NINJA_PROCESSES
461467
cp out/Default/.ninja_log out/electron_ninja_log
462468
node electron/script/check-symlinks.js
@@ -548,7 +554,7 @@ jobs:
548554
key: ${{ runner.os }}-build-artifacts-darwin-${{ env.TARGET_ARCH }}-${{ github.sha }}
549555
- name: Create MAS Config
550556
run: |
551-
mv src/electron/.github/workflows/config/evm.mas.json $HOME/.electron_build_tools/configs/evm.mas.json
557+
mv src/electron/.github/workflows/config/${{ inputs.GN_BUILD_TYPE }}/evm.mas.json $HOME/.electron_build_tools/configs/evm.mas.json
552558
echo "MAS_BUILD=true" >> $GITHUB_ENV
553559
e use mas
554560
- name: Build Electron (mas)
@@ -718,7 +724,8 @@ jobs:
718724
steps:
719725
- name: Load Build Tools
720726
run: |
721-
yarn add git://github.com/electron/build-tools.git#2bb63e2e7877491b52f972532b52adc979a6ec2f
727+
export BUILD_TOOLS_SHA=2bb63e2e7877491b52f972532b52adc979a6ec2f
728+
npm i -g @electron/build-tools
722729
e init --root=$(pwd) --out=Default ${{ inputs.GN_BUILD_TYPE }}
723730
- name: Checkout Electron
724731
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b

script/release/prepare-release.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const bumpType = args._[0];
1717
const targetRepo = getRepo();
1818

1919
function getRepo () {
20-
if (process.env.IS_GHA_RELEASE) return 'test-releases';
2120
return bumpType === 'nightly' ? 'nightlies' : 'electron';
2221
}
2322

@@ -128,7 +127,23 @@ async function createRelease (branchToTarget, isBeta) {
128127
process.exit(1);
129128
});
130129

130+
const ghaTestRelease = await octokit.repos.createRelease({
131+
owner: 'electron',
132+
repo: 'test-releases',
133+
tag_name: newVersion,
134+
draft: true,
135+
name: `electron ${newVersion}`,
136+
body: releaseBody,
137+
prerelease: releaseIsPrelease,
138+
target_commitish: newVersion.includes('nightly') ? 'main' : branchToTarget
139+
}).catch(err => {
140+
console.log(`${fail} Error creating new GHA test release: `, err);
141+
});
142+
131143
console.log(`Release has been created with id: ${release.data.id}.`);
144+
if (ghaTestRelease && ghaTestRelease.data) {
145+
console.log(`Test Release has been created with id: ${ghaTestRelease.data.id}.`);
146+
}
132147
console.log(`${pass} Draft release for ${newVersion} successful.`);
133148
}
134149

0 commit comments

Comments
 (0)