Skip to content

Commit

Permalink
feat: CI for CEF
Browse files Browse the repository at this point in the history
- depot_tools update
  • Loading branch information
prikolium-cfx committed May 3, 2024
1 parent de3f693 commit c72eb02
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CEF Build CI

on:
workflow_dispatch:

jobs:
build:
runs-on: self-hosted

steps:
- name: Support longpaths
run: git config --global core.longpaths true

- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Add depot_tools and ninja to PATH
run: |
echo "$env:GITHUB_WORKSPACE\depot_tools" >> $GITHUB_PATH
echo "$env:GITHUB_WORKSPACE\ninja" >> $GITHUB_PATH
- name: Prepare Depot
working-directory: ${{ github.workspace }}
run: |
cd .\build
.\prepare-depot.ps1
- name: Build CEF
working-directory: ${{ github.workspace }}
run: |
cd .\build
.\build.ps1
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release_build
path: chromium_git/chromium/src/cef/binary_distrib/*.zip

- name: Create draft release
uses: softprops/action-gh-release@v2
with:
draft: true
# repository: citizenfx/cef
name: ${{ format('build-{0}', github.run_id) }}
tag_name: ${{ format('build-{0}', github.run_id) }}
files: chromium_git/chromium/src/cef/binary_distrib/*.zip
32 changes: 32 additions & 0 deletions build/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Define environment variables
$env:GN_DEFINES = "is_chrome_branded=false symbol_level=1 is_official_build=true use_thin_lto=false proprietary_codecs=true ffmpeg_branding=Chrome"
$env:GYP_MSVS_VERSION = "2022"

# Get the current directory of the script
$CURRENT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Path
Write-Host "Current directory: $CURRENT_DIR"

# Define the directory to be mounted
$MOUNT_DIR = Split-Path -Path $CURRENT_DIR -Parent
Write-Host "Mount directory: $MOUNT_DIR"

Invoke-Expression "subst X: /D" -ErrorAction SilentlyContinue
Invoke-Expression "subst X: $MOUNT_DIR" -ErrorAction SilentlyContinue

# Define more variables using the new drive mapping
$DOWNLOAD_DIR = "X:\chromium_git"
$DEPOT_TOOLS_DIR = "X:\depot_tools"

# Execute the build using dynamic paths
& python "X:\build\automate-git.py" `
--url="https://github.com/citizenfx/cef.git" `
--checkout="cfx-m124" `
--download-dir="$DOWNLOAD_DIR" `
--depot-tools-dir="$DEPOT_TOOLS_DIR" `
--x64-build `
--no-cef-update `
--no-depot-tools-update `
--with-pgo-profiles $args

# Attempt to clean up and remove X: mapping at the end; ignore errors
Invoke-Expression "subst X: /D" -ErrorAction SilentlyContinue
12 changes: 12 additions & 0 deletions build/prepare-depot.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$ErrorActionPreference = 'SilentlyContinue'

Set-Location -Path "..\depot_tools"

Remove-Item -Path ".cipd_bin", ".cipd_client_cache", ".versions", "external_bin" -Recurse -Force
Remove-Item -Path ".cipd_client.exe", "gclient_utils.pyc", "git-bash", "git.bat", "gitk.bat", "metrics.cfg", "python_bin_reldir.txt", "python.bat", "python3_bit_reldir.txt", "python3.bat", "ssh-keygen.bat", "sh.bat", "subrpocess2.pyc" -Force

Set-Location -Path "bootstrap"

& ".\win_tools.bat"

Set-Location -Path "..\..\build"
2 changes: 1 addition & 1 deletion depot_tools
Submodule depot_tools updated from a5c46d to 22de5f

0 comments on commit c72eb02

Please sign in to comment.