electron/.forgejo/workflows/generate-tarball.yml

97 lines
4.7 KiB
YAML
Raw Normal View History

2024-10-10 19:14:07 +00:00
on:
workflow_dispatch:
inputs:
ref_name:
description: 'electron tag or commit'
2024-10-10 19:14:07 +00:00
required: true
type: string
chromium_ver:
description: 'chromium tag or commit'
required: false
type: string
2024-10-10 19:14:07 +00:00
push:
tags:
- 'v3*'
tags-ignore:
- '*-nightly*'
- '*-beta*'
- '*-alpha*'
jobs:
build-tarball:
name: Build tarball
runs-on: x86_64
container:
image: alpine:3.19
env:
VPYTHON_BYPASS: manually managed python not supported by chrome operations
ZSTD_LIMIT: 0
2024-10-10 19:54:34 +00:00
DEPOT_TOOLS_VER: 495b23b39aaba2ca3b55dd27cadc523f1cb17ee6
2024-10-10 19:14:07 +00:00
steps:
- name: Environment setup
run: apk add nodejs git zstd tar sed bash py3-httplib2 wget curl
2024-10-10 19:41:56 +00:00
- name: Getting depot_tools
run: |
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ./
git fetch --depth 1 origin $DEPOT_TOOLS_VER
git checkout $DEPOT_TOOLS_VER
- name: Getting variables
run: |
if test $GITHUB_REF_NAME == "ci" ; then
CI_REF_NAME=${{ inputs.ref_name }}
_chromiumver=${{ inputs.chromium_ver }}
else
CI_REF_NAME=$GITHUB_REF_NAME
fi
2024-10-10 19:41:56 +00:00
echo $CI_REF_NAME > ci_ref_name
if [ -n "$_chromiumver" ]; then
echo $_chromiumver > chromiumver
else
curl --silent https://raw.githubusercontent.com/electron/electron/$CI_REF_NAME/DEPS | grep "'chromium_version':" -A 1 | tail -n 1 | tr -d "'" | tr -d ',' | tr -d ' ' > chromiumver
fi
2024-10-10 19:14:07 +00:00
- name: Fetching electron
run: |
2024-10-10 19:41:56 +00:00
read CI_REF_NAME < ci_ref_name
read _chromiumver < chromiumver
2024-10-10 19:57:48 +00:00
echo "solutions = [{'name': 'src/electron','url': 'https://github.com/electron/electron.git@$CI_REF_NAME','deps_file': 'DEPS','managed': False,'custom_deps': {'src': 'https://chromium.googlesource.com/chromium/src.git@$_chromiumver',},'custom_vars': {},},]" > .gclient
2024-10-10 19:14:07 +00:00
./gclient sync --no-history --nohooks
- name: Preparing source
run: |
2024-10-10 19:41:56 +00:00
read _chromiumver < chromiumver
read CI_REF_NAME < ci_ref_name
2024-10-10 19:14:07 +00:00
python3 src/build/landmines.py
python3 src/build/util/lastchange.py -o src/build/util/LASTCHANGE
python3 src/build/util/lastchange.py -s src/third_party/dawn --revision src/gpu/webgpu/DAWN_VERSION
python3 src/build/util/lastchange.py -m GPU_LISTS_VERSION --revision-id-only --header src/gpu/config/gpu_lists_version.h
python3 src/build/util/lastchange.py -m SKIA_COMMIT_HASH -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
# rolled newer chromium with it included
sed -i '/reland_mojom_ts_generator_handle_empty_module_path_identically_to.patch/d' src/electron/patches/chromium/.patches
python3 src/electron/script/apply_all_patches.py src/electron/patches/config.json
2024-10-10 19:17:55 +00:00
# extra binaries are most likely things we don't want, so nuke them all
2024-10-10 19:14:07 +00:00
scanelf -RA -F "%F" src > elf.list
while read file; do rm -f "$file"; done < elf.list
mv src electron-$CI_REF_NAME-$_chromiumver
2024-10-10 19:14:07 +00:00
- name: Packaging source
run: |
2024-10-10 19:41:56 +00:00
read CI_REF_NAME < ci_ref_name
read _chromiumver < chromiumver
2024-10-10 20:47:33 +00:00
tar -cf $pkgname-$CI_REF_NAME-$_chromium.tar --exclude="ChangeLog*" --exclude="testdata/*" --exclude="test_data/*" --exclude="android_rust_toolchain/*" --exclude-backups --exclude-caches-all --exclude-vcs electron-$CI_REF_NAME-$_chromiumver
2024-10-10 19:14:07 +00:00
zstd --auto-threads=logical --ultra --long -22 -T"${ZSTD_LIMIT:-0}" -vv electron-$CI_REF_NAME-$_chromiumver.tar -o electron-$CI_REF_NAME-$_chromiumver.tar.zst
2024-10-10 19:14:07 +00:00
- name: Computing checksums
run: |
2024-10-10 19:41:56 +00:00
read CI_REF_NAME < ci_ref_name
read _chromiumver < chromiumver
sha512sum electron-$CI_REF_NAME-$_chromiumver.tar.zst > electron-$CI_REF_NAME-$_chromiumver.tar.zst.sha512sum
2024-10-10 19:14:07 +00:00
- name: Package deployment
run: |
2024-10-10 19:41:56 +00:00
read CI_REF_NAME < ci_ref_name
read _chromiumver < chromiumver
echo "Sending to ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.tar.zst"
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file electron-*.tar.zst ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.tar.zst
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file electron-*.tar.zst.sha512sum ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.zst.sha512sum