Update to version 0.14.0 #171
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI for GDCEF Godot 4.x | |
on: | |
workflow_dispatch: # Allow manual trigger | |
push: | |
branches: | |
- godot-4.x | |
tags: | |
- '*' # Trigger on any tag | |
pull_request: | |
branches: | |
- godot-4.x | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
# MacOS build configuration | |
- os: macos-14 | |
name: MacOS | |
check_files: cef_artifacts/libgdcef.dylib | |
install_system_packages: brew install ninja | |
shell: bash | |
# Linux build configuration | |
- os: ubuntu-20.04 | |
name: Linux | |
check_files: cef_artifacts/gdCefRenderProcess cef_artifacts/libgdcef.so cef_artifacts/libcef.so | |
install_system_packages: sudo apt-get update | |
shell: bash | |
# Windows build configuration | |
- os: windows-2022 | |
name: Windows | |
check_files: \a\gdcef\gdcef\cef_artifacts\gdCefRenderProcess.exe \a\gdcef\gdcef\cef_artifacts\libgdcef.dll \a\gdcef\gdcef\cef_artifacts\libcef.dll | |
shell: powershell | |
name: Build on ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
# Needed because Godot editor and godot-cpp can find cl.exe while our | |
# godot native modules cannot find it without this extra path | |
- name: Setup MSVC (Windows only) | |
if: matrix.os == 'windows-2022' | |
uses: ilammy/msvc-dev-cmd@v1.10.0 | |
# Git checkout the gdCEF repository | |
- name: Checkout GDCEF | |
uses: actions/checkout@v4 | |
with: | |
ref: godot-4.x | |
submodules: true | |
# Read the gdCEF version from the VERSION file, and set the name of the | |
# archive to upload on GitHub | |
- name: Get CI environment variables | |
id: archive | |
shell: bash | |
run: | | |
echo "tarball_name=gdCEF-$(cat VERSION)_Godot-4_${{ runner.os }}_${{ runner.arch }}.tar.gz" >> $GITHUB_OUTPUT | |
# Install system packages if any are specified and install python packages | |
- name: Install system packages | |
if: matrix.install_system_packages != '' | |
run: ${{ matrix.install_system_packages }} | |
# Setup Python Virtual Environment | |
- name: Setup Python Virtual Environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.7' | |
cache: 'pip' | |
cache-dependency-path: addons/gdcef/requirements.txt | |
# Install Python dependencies | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r addons/gdcef/requirements.txt | |
# Compile GDCEF: download CEF and godot-cpp, them, compile GDCEF | |
- name: Compile GDCEF | |
run: | | |
cd addons/gdcef | |
python3 build.py | |
# Check the build: list the files and create an archive | |
- name: Check build (Linux/MacOS) | |
if: runner.os != 'Windows' | |
run: | | |
ls ${{ matrix.check_files }} | |
cd cef_artifacts | |
# Check the build: check if important gdcef artifacts exist and create an archive | |
- name: Check build (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
cd cef_artifacts | |
foreach ($file in "${{ matrix.check_files }}".Split(" ")) { | |
if (!(Test-Path -Path $file)) { exit 1 } | |
} | |
# Create cef_artifacts archive | |
- name: Create cef_artifacts archive | |
shell: bash | |
run: | | |
tar -czvf ../${{ steps.archive.outputs.tarball_name }} cef_artifacts | |
# Upload the archive to GitHub for making a release artifact | |
- name: Upload artifact | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: ${{ steps.archive.outputs.tarball_name }} | |
# Create a GitHub release with the artifacts | |
release: | |
needs: build | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
# Download all artifacts | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifacts | |
path: artifacts | |
# Create a GitHub release with the artifacts | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "artifacts/*" | |
allowUpdates: true | |
makeLatest: true |