This commit is contained in:
parent
6bed06bb6c
commit
fd11252245
2 changed files with 130 additions and 0 deletions
79
.forgejo/workflows/generate-tarball.yml
Normal file
79
.forgejo/workflows/generate-tarball.yml
Normal file
|
@ -0,0 +1,79 @@
|
|||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref_name:
|
||||
description: 'tag or commit'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
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
|
||||
GITHUB_REF_NAME: ${{ inputs.ref_name }}
|
||||
steps:
|
||||
- name: Environment setup
|
||||
run: apk add nodejs git zstd tar sed bash py3-httplib2 wget curl
|
||||
- name: Getting variables
|
||||
run: |
|
||||
echo $GITHUB_REF_NAME
|
||||
curl --silent https://raw.githubusercontent.com/electron/electron/$GITHUB_REF_NAME/.github/actions/install-build-tools/action.yml | grep BUILD_TOOLS_SHA | awk -F "=" '{print $2}' > depottoolsver
|
||||
curl --silent https://raw.githubusercontent.com/electron/electron/$GITHUB_REF_NAME/DEPS | grep "'chromium_version':" -A 1 | tail -n 1 | tr -d "'" | tr -d ',' | tr -d ' ' > chromiumver
|
||||
- name: Getting depot_tools
|
||||
run: |
|
||||
read _depottoolsver < depottoolsver
|
||||
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ./
|
||||
git fetch --depth 1 origin $_depottoolsver
|
||||
git checkout $_depottoolsver
|
||||
- name: Fetching electron
|
||||
run: |
|
||||
read _chromiumver < chromiumver
|
||||
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
|
||||
./gclient sync --no-history --nohooks
|
||||
- name: Preparing source
|
||||
run: |
|
||||
read _chromiumver < chromiumver
|
||||
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
|
||||
|
||||
# extra binaries are most likely things we don't want, so nuke them all
|
||||
scanelf -RA -F "%F" src > elf.list
|
||||
while read file; do rm -f "$file"; done < elf.list
|
||||
mv src electron-$GITHUB_REF_NAME-$_chromiumver
|
||||
- name: Packaging source
|
||||
run: |
|
||||
read _chromiumver < chromiumver
|
||||
tar -cf $pkgname-$_semver-$_chromium.tar --exclude="ChangeLog*" --exclude="testdata/*" --exclude="test_data/*" --exclude="android_rust_toolchain/*" --exclude-backups --exclude-caches-all --exclude-vcs electron-$GITHUB_REF_NAME-$_chromiumver
|
||||
|
||||
zstd --auto-threads=logical --ultra --long -22 -T"${ZSTD_LIMIT:-0}" -vv electron-$GITHUB_REF_NAME-$_chromiumver.tar -o electron-$GITHUB_REF_NAME-$_chromiumver.tar.zst
|
||||
- name: Computing checksums
|
||||
run: |
|
||||
read _chromiumver < chromiumver
|
||||
sha512sum electron-$GITHUB_REF_NAME-$_chromiumver.tar.zst > electron-$GITHUB_REF_NAME-$_chromiumver.tar.zst.sha512sum
|
||||
- name: Package deployment
|
||||
run: |
|
||||
read _chromiumver < chromiumver
|
||||
echo "Sending to ${{ github.server_url }}/api/packages/mirrors/generic/electron/$GITHUB_REF_NAME/electron-$GITHUB_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/$GITHUB_REF_NAME/electron-$GITHUB_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/$GITHUB_REF_NAME/electron-$GITHUB_REF_NAME-$_chromiumver.zst.sha512sum
|
51
.forgejo/workflows/mirror-repository.yml
Normal file
51
.forgejo/workflows/mirror-repository.yml
Normal file
|
@ -0,0 +1,51 @@
|
|||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
schedule:
|
||||
- cron: '@hourly'
|
||||
|
||||
jobs:
|
||||
mirror:
|
||||
name: Pull from upstream
|
||||
runs-on: x86_64
|
||||
container:
|
||||
image: alpine:latest
|
||||
env:
|
||||
upstream: https://github.com/electron/electron
|
||||
tags: 'v30.5.2'
|
||||
steps:
|
||||
- name: Environment setup
|
||||
run: apk add grep git sed coreutils bash nodejs
|
||||
- name: Fetch destination
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch_depth: 1
|
||||
ref: ci
|
||||
token: ${{ secrets.CODE_FORGEJO_TOKEN }}
|
||||
- name: Missing tag detecting
|
||||
run: |
|
||||
git ls-remote $upstream "refs/tags/$tags" | grep -v '{' | sed 's|.*/||' > upstream_tags
|
||||
git ls-remote ${{ github.server_url}}/${{ github.repository }} "refs/tags/$tags" | grep -v '{' | sed 's|.*/||' > destination_tags
|
||||
cat upstream_tags destination_tags | tr ' ' '\n' | sort | uniq -u > missing_tags
|
||||
echo "Missing tags:"
|
||||
cat missing_tags
|
||||
- name: Missing tag fetch
|
||||
run: |
|
||||
git remote add upstream $upstream
|
||||
while read tag; do
|
||||
git fetch upstream tag $tag --no-tags
|
||||
done < missing_tags
|
||||
- name: Packaging workflow injection
|
||||
run: |
|
||||
while read tag; do
|
||||
git checkout $tag
|
||||
git tag -d $tag
|
||||
git checkout ci -- ./.forgejo
|
||||
git config user.name "forgejo-actions[bot]"
|
||||
git config user.email "dev@ayakael.net"
|
||||
git commit -m 'Inject custom workflow'
|
||||
git tag -a $tag -m $tag
|
||||
done < missing_tags
|
||||
- name: Push to destination
|
||||
run: git push --force origin refs/tags/*:refs/tags/* --tags
|
||||
|
Loading…
Reference in a new issue