Skip to content

Build Additional Targets #14

Build Additional Targets

Build Additional Targets #14

name: Build Additional Targets
permissions:
actions: none
checks: none
contents: none
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
on:
workflow_dispatch:
inputs:
sha:
description: 'uazo/cromite SHA'
required: true
default: ''
type:
description: 'runner? [dev/ci]'
required: true
default: 'ci'
debug:
description: 'debug? [true/false]'
required: true
default: 'false'
env:
CROMITE_SHA: ${{ github.event.inputs.sha }}
REMOVEDOCKERSUPPORT: true
USELOCALIMAGE: true
jobs:
check_images:
runs-on: ${{ github.event.inputs.type }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
path: cromite
ref: ${{ github.event.inputs.sha }}
fetch-depth: 1
- name: Enable proxy on container
shell: bash
run: |
if ! [[ -z "${HTTP_PROXY}" ]]; then
PROXY_ADDR=http://$(hostname -I | cut -d' ' -f1 | xargs):8118
echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV
sudo iptables -D INPUT -p tcp -s localhost --dport 8118 -j ACCEPT
sudo iptables -D INPUT -p tcp --dport 8118 -j DROP
fi
- name: Get current chromium version
shell: bash
run: |
export VERSION=$( cat ./cromite/build/RELEASE )
echo Current version is $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
cd cromite/tools
- name: Get uazo/cromite-build from docker hub if present
shell: bash
run: |
IS_PRESENT=$(docker manifest inspect uazo/cromite-build:$VERSION-$CROMITE_SHA > /dev/null ; echo $?)
if [ $IS_PRESENT -eq "0" ]; then
docker pull uazo/cromite-build:$VERSION-$CROMITE_SHA
fi
- name: Mark image to build
shell: bash
run: |
IS_PRESENT=$(docker inspect --type=image uazo/cromite-build:build > /dev/null ; echo $?)
if [ $IS_PRESENT -eq "0" ]; then
docker rmi uazo/cromite-build:build
fi
docker tag uazo/cromite-build:$VERSION-$CROMITE_SHA uazo/cromite-build:build
build:
runs-on: ${{ github.event.inputs.type }}
needs: check_images
if: success()
timeout-minutes: 1440
container:
image: uazo/cromite-build:build
env:
REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket
USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images
USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal
WORKSPACE: /home/lg/working_dir
# kythe
KYTHE_CORPUS: chromium.googlesource.com/chromium/src
KYTHE_ROOT_DIRECTORY: /home/lg/working_dir/chromium/src
KYTHE_OUTPUT_DIRECTORY: /home/lg/working_dir/chromium/src/out/arm64/kythe
# cross build
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: /win_sdk/10.0.22621.0/
WINDOWSSDKDIR: "/win_sdk/10.0.22621.0/Windows Kits/10/"
GYP_MSVS_OVERRIDE_PATH: /win_sdk/10.0.22621.0/
# compile in debug mode
TARGET_ISDEBUG: ${{ github.event.inputs.debug }}
USE_KEYSTORE: true
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
CROMITE_PREF_HASH_SEED_BIN: ${{ secrets.CROMITE_PREF_HASH_SEED_BIN }}
volumes:
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/chr_arm:/home/lg/working_dir/chromium/src/out/chr_arm
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/chr_arm64:/home/lg/working_dir/chromium/src/out/chr_arm64
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/chr_x64:/home/lg/working_dir/chromium/src/out/chr_x64
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/x64_webview:/home/lg/working_dir/chromium/src/out/x64_webview
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/arm64_webview:/home/lg/working_dir/chromium/src/out/arm64_webview
- /tmp/proxy:/tmp/proxy
- /win_sdk:/win_sdk
steps:
- name: Prepare Build Container
shell: bash
run: |
# set workspace paths
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
cd $WORKSPACE
# reset proxy env
HTTP_PROXY=
HTTPS_PROXY=
http_proxy=
https_proxy=
# set out folder permissions
test -d chromium/src/out/chr_arm || sudo mkdir -p chromium/src/out/chr_arm && \
sudo chown lg chromium/src/out &&
sudo chown lg chromium/src/out/chr_arm
test -d chromium/src/out/chr_arm64 || sudo mkdir -p chromium/src/out/chr_arm64 && \
sudo chown lg chromium/src/out &&
sudo chown lg chromium/src/out/chr_arm64
test -d chromium/src/out/chr_x64 || sudo mkdir -p chromium/src/out/chr_x64 && \
sudo chown lg chromium/src/out &&
sudo chown lg chromium/src/out/chr_x64
test -d chromium/src/out/x64_webview || sudo mkdir -p chromium/src/out/x64_webview && \
sudo chown lg chromium/src/out &&
sudo chown lg chromium/src/out/x64_webview
test -d chromium/src/out/arm64_webview || sudo mkdir -p chromium/src/out/arm64_webview && \
sudo chown lg chromium/src/out &&
sudo chown lg chromium/src/out/arm64_webview
sudo mkdir -p /run/user/1000/
sudo chown lg /run/user/1000/
sudo chmod g-rxw /run/user/1000/
sudo chmod o-rxw /run/user/1000/
# prepare keystore
echo "::group::-------- prepare keystore"
cd $WORKSPACE
echo "${{ secrets.KEYSTORE }}" > cromite.keystore.asc
gpg --homedir ./ -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch cromite.keystore.asc > cromite.keystore
echo "::endgroup::"
- name: Build Cromite System WebView x64
shell: bash
run: |
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
cd $WORKSPACE/chromium/src
echo "::group::-------- gn gen"
gn gen --args="target_os = \"android\" target_cpu = \"x64\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) system_webview_package_name=\"com.android.webview\" skip_secondary_abi_for_cq = true enable_trybot_verification=false " out/x64_webview
echo "::endgroup::"
echo "::group::-------- gn args"
gn args out/x64_webview/ --list --short
gn args out/x64_webview/ --list >out/x64_webview/gn_list
echo "::endgroup::"
ninja -C out/x64_webview system_webview_apk system_webview_shell
cp ../../cromite/build/RELEASE out/x64_webview
- name: Build Cromite System WebView arm64
shell: bash
run: |
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
cd $WORKSPACE/chromium/src
echo "::group::-------- gn gen"
gn gen --args="target_os = \"android\" target_cpu = \"arm64\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) system_webview_package_name=\"com.android.webview\" skip_secondary_abi_for_cq = true enable_trybot_verification=false " out/arm64_webview
echo "::endgroup::"
echo "::group::-------- gn args"
gn args out/arm64_webview/ --list --short
gn args out/arm64_webview/ --list >out/arm64_webview/gn_list
echo "::endgroup::"
ninja -C out/arm64_webview system_webview_apk system_webview_shell
cp ../../cromite/build/RELEASE out/arm64_webview
- name: Prepare Build Container for vanilla chromium
shell: bash
run: |
# set workspace paths
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
cd $WORKSPACE/chromium/src
# checkout chromium commit
LAST_PATCH=$(git log --all --grep='Fix-chromium-vanilla.patch' --format="%H")
git checkout $LAST_PATCH
- name: Build Chromium Vanilla Android x64
shell: bash
run: |
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
cd $WORKSPACE/chromium/src
echo "::group::-------- gn gen"
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/chromium.gn_args) target_cpu = \"x64\" " out/chr_x64
echo "::endgroup::"
echo "::group::-------- gn args"
gn args out/chr_x64/ --list --short
gn args out/chr_x64/ --list >out/chr_x64/gn_list
echo "::endgroup::"
ninja -C out/chr_x64 chrome_public_apk
cp ../../cromite/build/RELEASE out/chr_x64
- name: Build Chromium Vanilla Android arm64
shell: bash
run: |
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
cd $WORKSPACE/chromium/src
echo "::group::-------- gn gen"
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/chromium.gn_args) target_cpu = \"arm64\" " out/chr_arm64
echo "::endgroup::"
echo "::group::-------- gn args"
gn args out/chr_arm64/ --list --short
gn args out/chr_arm64/ --list >out/chr_arm64/gn_list
echo "::endgroup::"
ninja -C out/chr_arm64 chrome_public_apk
cp ../../cromite/build/RELEASE out/chr_arm64
- name: Build Chromium Vanilla Android arm
shell: bash
run: |
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
cd $WORKSPACE/chromium/src
echo "::group::-------- gn gen"
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/chromium.gn_args) target_cpu = \"arm\" " out/chr_arm
echo "::endgroup::"
echo "::group::-------- gn args"
gn args out/chr_arm/ --list --short
gn args out/chr_arm/ --list >out/chr_arm/gn_list
echo "::endgroup::"
ninja -C out/chr_arm chrome_public_apk
cp ../../cromite/build/RELEASE out/chr_arm