Skip to content

get image memory requirements #720

get image memory requirements

get image memory requirements #720

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 (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
cache_key: windows-x64
msvc_arch: x64
- target: aarch64-pc-windows-msvc
cache_key: windows-arm64
msvc_arch: amd64_arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust and CEF
uses: ./.github/actions/setup-rust-cef
with:
target: ${{ matrix.target }}
cef-cache-key: ${{ matrix.cache_key }}
cargo-cache-prefix: windows
msvc-arch: ${{ matrix.msvc_arch }}
- name: Build and bundle for Windows
env:
RUSTC_WRAPPER: sccache
run: mise exec -- cargo xtask bundle --release --target ${{ matrix.target }}
- name: Prepare artifacts
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path artifacts/${{ matrix.target }}
Copy-Item -Recurse addons/godot_cef/bin/${{ matrix.target }}/* artifacts/${{ matrix.target }}/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdcef-${{ matrix.target }}
path: artifacts/${{ matrix.target }}
retention-days: 30
build-linux:
runs-on: ubuntu-latest
name: Linux (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
cache_key: linux-x64
- target: aarch64-unknown-linux-gnu
cache_key: linux-arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust and CEF
uses: ./.github/actions/setup-rust-cef
with:
target: ${{ matrix.target }}
cef-cache-key: ${{ matrix.cache_key }}
cargo-cache-prefix: linux
install-linux-deps: "true"
- name: Build and bundle for Linux
env:
RUSTC_WRAPPER: sccache
run: mise exec -- cargo xtask bundle --release --target ${{ matrix.target }}
- name: Prepare artifacts
run: |
mkdir -p artifacts/${{ matrix.target }}
cp -r addons/godot_cef/bin/${{ matrix.target }}/* artifacts/${{ matrix.target }}/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gdcef-${{ matrix.target }}
path: artifacts/${{ matrix.target }}
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
mise exec -- cargo xtask validate --addon dist/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