Build #50
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: Build | |
on: | |
workflow_dispatch: | |
env: | |
# Only used for the cache key. Increment version to force clean build. | |
GODOT_BASE_BRANCH: main | |
concurrency: | |
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}} | |
cancel-in-progress: true | |
jobs: | |
cmake: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- name: 🏁 Build (Windows, MSVC, x86_64) | |
os: windows-2022 | |
artifact: windows-x64 | |
env: | |
VCPKG_DEFAULT_TRIPLET: x64-windows | |
Debug_configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=\"Debug\"']" | |
Debug_buildPresetAdditionalArgs: '[`--config Debug`]' | |
Release_configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=\"Release\"']" | |
Release_buildPresetAdditionalArgs: '[`--config Release`]' | |
- name: 🐧 Build (Linux, GCC, x86_64) | |
os: ubuntu-24.04 | |
artifact: linux-x64 | |
env: | |
VCPKG_DEFAULT_TRIPLET: x64-linux | |
CC: gcc-13 | |
CXX: g++-13 | |
Debug_configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=\"Debug\"']" | |
Debug_buildPresetAdditionalArgs: '[`--config Debug`]' | |
Release_configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=\"Release\"']" | |
Release_buildPresetAdditionalArgs: '[`--config Release`]' | |
- name: 🍎 Build (MacOS, Clang, arm64) | |
os: macos-latest | |
artifact: macos-arm64 | |
env: | |
VCPKG_DEFAULT_TRIPLET: arm64-osx | |
Debug_configurePresetAdditionalArgs: "['-DCMAKE_OSX_ARCHITECTURES=\"arm64\"', '-DCMAKE_BUILD_TYPE=\"Debug\"']" | |
Debug_buildPresetAdditionalArgs: '[`--config Debug`]' | |
Release_configurePresetAdditionalArgs: "['-DCMAKE_OSX_ARCHITECTURES=\"arm64\"', '-DCMAKE_BUILD_TYPE=\"Release\"']" | |
Release_buildPresetAdditionalArgs: '[`--config Release`]' | |
- name: 🍎 Build (MacOS, Clang, x86_64) | |
os: macos-latest | |
artifact: macos-x86_64 | |
env: | |
VCPKG_DEFAULT_TRIPLET: x64-osx | |
Debug_configurePresetAdditionalArgs: "['-DCMAKE_OSX_ARCHITECTURES=\"x86_64\"', '-DCMAKE_BUILD_TYPE=\"Debug\"']" | |
Debug_buildPresetAdditionalArgs: '[`--config Debug`]' | |
Release_configurePresetAdditionalArgs: "['-DCMAKE_OSX_ARCHITECTURES=\"x86_64\"', '-DCMAKE_BUILD_TYPE=\"Release\"']" | |
Release_buildPresetAdditionalArgs: '[`--config Release`]' | |
env: ${{ matrix.env }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
token: ${{ secrets.PRIVATE_TOKEN }} | |
# Install latest CMake and Ninja. | |
- uses: lukka/get-cmake@latest | |
# Setup vcpkg: ensures vcpkg is downloaded and built. | |
# Since vcpkg.json is being used later on to install the packages | |
# when `run-cmake` runs, no packages are installed at this time | |
# (and vcpkg does not run). | |
- name: Setup anew (or from cache) vcpkg (and does not build any package) | |
uses: lukka/run-vcpkg@v11 # Always specify the specific _version_ of the | |
# action you need, `v11` in this case to stay up | |
# to date with fixes on the v11 branch. | |
with: | |
vcpkgGitCommitId: 'd07689ef165f033de5c0710e4f67c193a85373e1' | |
- name: Install dependencies | |
if: ${{ matrix.os == 'ubuntu-24.04' }} | |
run: | | |
sudo apt-get update -qq | |
sudo apt-get install -qqq build-essential pkg-config gcc-13 g++-13 | |
- name: Run CMake consuming CMakePreset.json (Debug) | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: default | |
configurePresetAdditionalArgs: ${{ matrix.Debug_configurePresetAdditionalArgs }} | |
buildPreset: default | |
buildPresetAdditionalArgs: ${{ matrix.Debug_buildPresetAdditionalArgs }} | |
- name: Run CMake consuming CMakePreset.json (Release) | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: default | |
configurePresetAdditionalArgs: ${{ matrix.Release_configurePresetAdditionalArgs }} | |
buildPreset: default | |
buildPresetAdditionalArgs: ${{ matrix.Release_buildPresetAdditionalArgs }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact }}.${{ github.ref_name }} | |
path: bin | |
retention-days: 1 | |
archive: | |
name: Archive all prebuilt library | |
runs-on: ubuntu-24.04 | |
needs: | |
- cmake | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts/addons/ultralight-view/bin | |
merge-multiple: true | |
- name: generate ultralight-view.gdextension | |
run: | | |
cat > artifacts/addons/ultralight-view/ultralight-view.gdextension <<EOF | |
[configuration] | |
entry_symbol = "ultralight_library_init" | |
compatibility_minimum = "4.3" | |
[libraries] | |
macos.debug.x86_64 = "bin/macos-x64/libultralight-view.macos.debug.x86_64.dylib" | |
macos.release.x86_64 = "bin/macos-x64/libultralight-view.macos.release.x86_64.dylib" | |
macos.debug.arm64 = "bin/macos-arm64/libultralight-view.macos.debug.arm64.dylib" | |
macos.release.arm64 = "bin/macos-arm64/libultralight-view.macos.release.arm64.dylib" | |
windows.debug.x86_64 = "bin/win64/ultralight-view.windows.debug.x86_64.dll" | |
windows.release.x86_64 = "bin/win64/ultralight-view.windows.release.x86_64.dll" | |
linux.debug.x86_64 = "bin/x11/libultralight-view.linux.debug.x86_64.so" | |
linux.release.x86_64 = "bin/x11/libultralight-view.linux.release.x86_64.so" | |
EOF | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ultralight-view.${{ github.ref_name }} | |
path: artifacts | |
retention-days: 2 |