This commit is contained in:
jqssun 2025-10-10 02:04:32 +00:00
commit b61b3e0ca9
8 changed files with 56 additions and 41 deletions

View file

@ -1,9 +1,6 @@
name: build
on:
push:
paths:
- VERSION
workflow_dispatch:
inputs:
runner:
@ -16,18 +13,17 @@ jobs:
build:
runs-on: ${{ github.event_name == 'workflow_dispatch' && inputs.runner || 'self-hosted' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true
- name: Set ENV
run: |
chmod +x *.sh
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
echo "unix_time=$(date +%s)" >> $GITHUB_ENV
echo "date_today=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Build
env:
VERSION: ${{ env.VERSION }}
DEBIAN_FRONTEND: noninteractive
LOCAL_TEST_JKS: ${{ secrets.LOCAL_TEST_JKS }}
STORE_TEST_JKS: ${{ secrets.STORE_TEST_JKS }}
@ -36,7 +32,9 @@ jobs:
- name: Set
run: |
mv $(find chromium/src/out/Default/apks/release -name '*.apk') ${{ env.VERSION }}-${{ env.unix_time }}.apk
export VERSION=$(find chromium/src/out/Default/apks/release -name '*.apk' | sed 's/.*\///;s/\.apk$//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
mv $(find chromium/src/out/Default/apks/release -name '*.apk') $VERSION-${{ env.unix_time }}.apk
- name: Publish
uses: softprops/action-gh-release@v2
@ -45,4 +43,4 @@ jobs:
name: v${{ env.VERSION }}
tag_name: v${{ env.VERSION }}
files: |
${{ env.VERSION }}-${{ env.unix_time }}.apk
${{ env.VERSION }}-${{ env.unix_time }}.apk

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
.DS_Store
chromium/
depot_tools/
keys/

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "helium"]
path = helium
url = https://github.com/imputnet/helium.git
[submodule "vanadium"]
path = vanadium
url = https://github.com/GrapheneOS/Vanadium.git

View file

@ -1 +0,0 @@
141.0.7390.55

View file

@ -2,12 +2,13 @@
source common.sh
set_keys
export VERSION=$(cat VERSION)
export CHROMIUM_SOURCE=https://github.com/chromium/chromium.git
# https://chromium.googlesource.com/chromium/src.git
export VERSION=$(grep -m1 -o '[0-9]\+\(\.[0-9]\+\)\{3\}' vanadium/args.gn)
export CHROMIUM_SOURCE=https://github.com/chromium/chromium.git # https://chromium.googlesource.com/chromium/src.git
export DEBIAN_FRONTEND=noninteractive
sudo apt update
sudo apt install -y sudo lsb-release file nano git curl python3
sudo apt install -y sudo lsb-release file nano git curl python3 python3-pillow
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# https://github.com/uazo/cromite/blob/master/tools/images/chr-source/prepare-build.sh
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
@ -19,7 +20,6 @@ git remote add origin $CHROMIUM_SOURCE
git fetch --depth 2 $CHROMIUM_SOURCE +refs/tags/$VERSION:chromium_$VERSION
git checkout $VERSION
export COMMIT=$(git show-ref -s $VERSION | head -n1)
cat > ../.gclient <<EOF
solutions = [
{
@ -38,58 +38,61 @@ target_os = ["android"]
EOF
git submodule foreach git config -f ./.git/config submodule.$name.ignore all
git config --add remote.origin.fetch '+refs/tags/*:refs/tags/*'
# https://grapheneos.org/build#browser-and-webview
replace "$SCRIPT_DIR/vanadium/patches" "VANADIUM" "HELIUM"
replace "$SCRIPT_DIR/vanadium/patches" "Vanadium" "Helium"
replace "$SCRIPT_DIR/vanadium/patches" "vanadium" "helium"
git am --whitespace=nowarn --keep-non-patch $SCRIPT_DIR/vanadium/patches/*.patch
gclient sync -D --no-history --nohooks
gclient runhooks
rm -rf third_party/angle/third_party/VK-GL-CTS/
./build/install-build-deps.sh --no-prompt
# add helium
sudo apt install -y python3-pillow
export _main_repo=$(realpath ../../helium)
export _src_dir=$(realpath .)
git clone --depth 1 https://github.com/imputnet/helium.git $_main_repo
python3 "${_main_repo}/utils/name_substitution.py" --sub -t "${_src_dir}"
python3 "${_main_repo}/utils/helium_version.py" --tree "${_main_repo}" --chromium-tree "${_src_dir}"
python3 "${_main_repo}/utils/generate_resources.py" "${_main_repo}/resources/generate_resources.txt" "${_main_repo}/resources"
python3 "${_main_repo}/utils/replace_resources.py" "${_main_repo}/resources/helium_resources.txt" "${_main_repo}/resources" "${_src_dir}"
# https://github.com/imputnet/helium-linux/blob/main/scripts/shared.sh
python3 "${SCRIPT_DIR}/helium/utils/name_substitution.py" --sub -t .
python3 "${SCRIPT_DIR}/helium/utils/helium_version.py" --tree "${SCRIPT_DIR}/helium" --chromium-tree .
python3 "${SCRIPT_DIR}/helium/utils/generate_resources.py" "${SCRIPT_DIR}/helium/resources/generate_resources.txt" "${SCRIPT_DIR}/helium/resources"
python3 "${SCRIPT_DIR}/helium/utils/replace_resources.py" "${SCRIPT_DIR}/helium/resources/helium_resources.txt" "${SCRIPT_DIR}/helium/resources" .
cat > out/Default/args.gn <<EOF
chrome_public_manifest_package = "io.github.jqssun.helium"
is_desktop_android = true
target_os = "android"
target_cpu = "arm64"
ffmpeg_branding="Chrome"
google_api_key="x"
google_default_client_id="x"
google_default_client_secret="x"
is_component_build = false
is_debug = false
is_official_build = true
symbol_level = 1
disable_fieldtrial_testing_config = true
ffmpeg_branding = "Chrome"
proprietary_codecs = true
enable_vr = false
enable_arcore = false
enable_openxr = false
enable_cardboard = false
enable_remoting = false
enable_reporting = false
google_api_key = "x"
google_default_client_id = "x"
google_default_client_secret = "x"
blink_symbol_level=1
build_contextual_search=false
build_with_tflite_lib=true
chrome_pgo_phase=0
dcheck_always_on=false
disable_fieldtrial_testing_config=true
enable_hangout_services_extension=false
enable_iterator_debugging=false
enable_mdns=false
enable_remoting=false
enable_reporting=false
enable_vr=false
exclude_unwind_tables=false
icu_use_data_file=true
is_component_build=false
is_official_build=true
is_debug=false
rtc_build_examples=false
symbol_level=1
use_debug_fission=true
use_errorprone_java_compiler=false
use_official_google_api_keys=false
use_rtti=false
enable_arcore=false
enable_openxr=false
enable_cardboard=false
proprietary_codecs=true
enable_av1_decoder=true
enable_dav1d_decoder=true
include_both_v8_snapshots = false
@ -102,4 +105,4 @@ autoninja -C out/Default chrome_public_apk
export PATH=$PWD/third_party/jdk/current/bin/:$PATH
export ANDROID_HOME=$PWD/third_party/android_sdk/public
mkdir -p out/Default/apks/release
sign_apk $(find out/Default/apks -name 'Chrome*.apk') out/Default/apks/release/ChromePublic.apk
sign_apk $(find out/Default/apks -name 'Chrome*.apk') out/Default/apks/release/$VERSION.apk

View file

@ -1,5 +1,10 @@
export SCRIPT_DIR=$(realpath $(dirname $0))
replace() {
export org=$2 new=$3
find $1 -type f -exec sed -i 's@'$org'@'$new'@g' {} \;
}
set_keys() {
mkdir -p $SCRIPT_DIR/keys
echo $LOCAL_TEST_JKS | base64 -d > $SCRIPT_DIR/keys/local.properties

1
helium Submodule

@ -0,0 +1 @@
Subproject commit 50e0255fe29fd03c29c2722afc4b11d4aafa92a4

1
vanadium Submodule

@ -0,0 +1 @@
Subproject commit 0ce1377179d8d2af8353801b7b884fb770a3ebf0