Skip to content

chore: update godot deps #698

chore: update godot deps

chore: update godot deps #698

Workflow file for this run

name: Build
permissions:
contents: read
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CEF_PATH: ${{ github.workspace }}/cef
SCCACHE_GHA_ENABLED: "true"
jobs:
build-macos:
runs-on: macos-latest
name: macOS
env:
CEF_PATH_ARM64: ${{ github.workspace }}/cef-arm64
CEF_PATH_X64: ${{ github.workspace }}/cef-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup mise toolchain
uses: jdx/mise-action@v2
with:
cache: true
- name: Install Rust targets
run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Cache Cargo registry and build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: macos-universal-cargo-${{ hashFiles('**/Cargo.lock', 'mise.toml') }}
restore-keys: |
macos-universal-cargo-
- name: Cache CEF binaries (ARM64)
uses: actions/cache@v4
id: cef-cache-arm64
with:
path: ${{ env.CEF_PATH_ARM64 }}
key: cef-${{ hashFiles('mise.toml') }}-macos-arm64
- name: Download CEF binaries (ARM64)
if: steps.cef-cache-arm64.outputs.cache-hit != 'true'
run: mise exec -- sh -c 'export-cef-dir --version "$CEF_VERSION" --force --target aarch64-apple-darwin "$CEF_PATH_ARM64"'
- name: Copy CEF binaries (ARM64)
run: |
mkdir -p ${{ env.CEF_PATH }}
cp -R ${{ env.CEF_PATH_ARM64 }}/* ${{ env.CEF_PATH }}/
- name: Cache CEF binaries (X64)
uses: actions/cache@v4
id: cef-cache-x64
with:
path: ${{ env.CEF_PATH_X64 }}
key: cef-${{ hashFiles('mise.toml') }}-macos-x64
- name: Download CEF binaries (X64)
if: steps.cef-cache-x64.outputs.cache-hit != 'true'
run: mise exec -- sh -c 'export-cef-dir --version "$CEF_VERSION" --force --target x86_64-apple-darwin "$CEF_PATH_X64"'
- name: Build and bundle for macOS (Universal)
env:
RUSTC_WRAPPER: sccache
run: mise exec -- cargo xtask bundle --release
- name: Prepare artifacts
run: |
mkdir -p artifacts/universal-apple-darwin
cp -R "target/release/Godot CEF.app" "artifacts/universal-apple-darwin/"
cp -R "target/release/Godot CEF.framework" "artifacts/universal-apple-darwin/"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdcef-universal-apple-darwin
path: artifacts/universal-apple-darwin
retention-days: 30
build-windows:
runs-on: windows-latest
name: Windows
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup mise toolchain
uses: jdx/mise-action@v2
with:
cache: true
- name: Install Rust target
run: rustup target add x86_64-pc-windows-msvc
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Cache Cargo registry and build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: windows-x86_64-cargo-${{ hashFiles('**/Cargo.lock', 'mise.toml') }}
restore-keys: |
windows-x86_64-cargo-
- name: Cache CEF binaries
uses: actions/cache@v4
id: cef-cache
with:
path: ${{ env.CEF_PATH }}
key: cef-${{ hashFiles('mise.toml') }}-windows-x64
- name: Download CEF binaries
if: steps.cef-cache.outputs.cache-hit != 'true'
shell: pwsh
run: mise exec -- pwsh -NoProfile -Command 'export-cef-dir --version $env:CEF_VERSION --force $env:CEF_PATH'
- name: Build and bundle for Windows
env:
RUSTC_WRAPPER: sccache
run: mise exec -- cargo xtask bundle --release
- name: Prepare artifacts
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path artifacts/x86_64-pc-windows-msvc
Copy-Item target/release/gdcef.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/gdcef_helper.exe artifacts/x86_64-pc-windows-msvc/
# Copy CEF assets
Copy-Item target/release/libcef.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/chrome_elf.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/libEGL.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/libGLESv2.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/d3dcompiler_47.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/dxcompiler.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/dxil.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/vk_swiftshader.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/vk_swiftshader_icd.json artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/vulkan-1.dll artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/icudtl.dat artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/resources.pak artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/chrome_100_percent.pak artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/chrome_200_percent.pak artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/v8_context_snapshot.bin artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/bootstrap.exe artifacts/x86_64-pc-windows-msvc/
Copy-Item target/release/bootstrapc.exe artifacts/x86_64-pc-windows-msvc/
Copy-Item -Recurse target/release/locales artifacts/x86_64-pc-windows-msvc/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdcef-x86_64-pc-windows-msvc
path: artifacts/x86_64-pc-windows-msvc
retention-days: 30
build-linux:
runs-on: ubuntu-latest
name: Linux
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
libgtk-3-dev \
libnss3-dev \
libatk1.0-dev \
libatk-bridge2.0-dev \
libcups2-dev \
libdrm-dev \
libxkbcommon-dev \
libxcomposite-dev \
libxdamage-dev \
libxrandr-dev \
libgbm-dev \
libpango1.0-dev \
libasound2-dev
- name: Setup mise toolchain
uses: jdx/mise-action@v2
with:
cache: true
- name: Install Rust target
run: rustup target add x86_64-unknown-linux-gnu
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Cache Cargo registry and build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: linux-x86_64-cargo-${{ hashFiles('**/Cargo.lock', 'mise.toml') }}
restore-keys: |
linux-x86_64-cargo-
- name: Cache CEF binaries
uses: actions/cache@v4
id: cef-cache
with:
path: ${{ env.CEF_PATH }}
key: cef-${{ hashFiles('mise.toml') }}-linux-x64
- name: Download CEF binaries
if: steps.cef-cache.outputs.cache-hit != 'true'
run: mise exec -- sh -c 'export-cef-dir --version "$CEF_VERSION" --force "$CEF_PATH"'
- name: Build and bundle for Linux
env:
RUSTC_WRAPPER: sccache
run: mise exec -- cargo xtask bundle --release
- name: Prepare artifacts
run: |
mkdir -p artifacts/x86_64-unknown-linux-gnu
cp target/release/libgdcef.so artifacts/x86_64-unknown-linux-gnu/
cp target/release/gdcef_helper artifacts/x86_64-unknown-linux-gnu/
# Copy CEF assets
cp target/release/libcef.so artifacts/x86_64-unknown-linux-gnu/
cp target/release/libEGL.so artifacts/x86_64-unknown-linux-gnu/
cp target/release/libGLESv2.so artifacts/x86_64-unknown-linux-gnu/
cp target/release/libvk_swiftshader.so artifacts/x86_64-unknown-linux-gnu/
cp target/release/libvulkan.so.1 artifacts/x86_64-unknown-linux-gnu/
cp target/release/vk_swiftshader_icd.json artifacts/x86_64-unknown-linux-gnu/
cp target/release/icudtl.dat artifacts/x86_64-unknown-linux-gnu/
cp target/release/resources.pak artifacts/x86_64-unknown-linux-gnu/
cp target/release/chrome_100_percent.pak artifacts/x86_64-unknown-linux-gnu/
cp target/release/chrome_200_percent.pak artifacts/x86_64-unknown-linux-gnu/
cp target/release/v8_context_snapshot.bin artifacts/x86_64-unknown-linux-gnu/
cp target/release/chrome-sandbox artifacts/x86_64-unknown-linux-gnu/
cp -r target/release/locales artifacts/x86_64-unknown-linux-gnu/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdcef-x86_64-unknown-linux-gnu
path: artifacts/x86_64-unknown-linux-gnu
retention-days: 30
pack:
needs: [build-macos, build-windows, build-linux]
runs-on: ubuntu-latest
name: Pack Addon
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup mise toolchain
uses: jdx/mise-action@v2
with:
cache: true
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Pack Godot addon
env:
RUSTC_WRAPPER: sccache
run: |
# Use staging directory to avoid deleting source addon files
mise exec -- cargo xtask pack \
--artifacts artifacts \
--output dist/addons/godot_cef \
--addon-src addons/godot_cef
# Use dist as ZIP root so Asset Library installs into res://addons/godot_cef.
zip -r godot_cef.zip dist
- name: Upload packed addon
uses: actions/upload-artifact@v4
with:
name: godot_cef-addon
path: godot_cef.zip
retention-days: 30
release:
needs: [pack]
runs-on: ubuntu-latest
name: Publish Release
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download packed addon
uses: actions/download-artifact@v4
with:
name: godot_cef-addon
path: .
- name: Rename addon with version
run: mv godot_cef.zip godot_cef-${{ github.ref_name }}.zip
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Godot CEF ${{ github.ref_name }}
draft: true # release is draft until it is manually published
prerelease: ${{ contains(github.ref_name, '-') }}
generate_release_notes: true
files: godot_cef-${{ github.ref_name }}.zip