macOS setup and copy required shared libraries to the application. #255
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: Build | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
on: | |
push: | |
paths: | |
- '**' | |
- '!README.md' | |
- '!LICENSE.txt' | |
- '!docs/**' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest, ubuntu-24.04-arm] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Vulkan SDK (without GLSL -> SPIR-V compiler) | |
if: ${{ runner.os != 'Windows' }} | |
uses: utzcoz/setup-vulkan-sdk@improve-cache-for-architectures | |
with: | |
vulkan-query-version: 1.3.296.0 | |
vulkan-components: Vulkan-Headers, Vulkan-Loader | |
vulkan-use-cache: true | |
- name: Install Vulkan SDK (with GLSL -> SPIR-V compiler) | |
if: ${{ runner.os == 'Windows' }} | |
uses: utzcoz/setup-vulkan-sdk@improve-cache-for-architectures | |
with: | |
vulkan-query-version: 1.3.296.0 | |
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools | |
vulkan-use-cache: true | |
- name: Install build dependencies (macOS) | |
if: ${{ runner.os == 'macOS' }} | |
run: brew install llvm ninja autoconf automake libtool nasm shaderc | |
- name: Install build dependencies (Linux) | |
if: ${{ runner.os == 'Linux' }} | |
run: sudo apt-get install ninja-build libc++-dev libc++abi-dev xorg-dev libtool libltdl-dev glslc | |
- name: Setup vcpkg (macOS) | |
if: ${{ runner.os == 'macOS' }} | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git --depth 1 | |
cd vcpkg && ./bootstrap-vcpkg.sh | |
echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" >> $GITHUB_ENV | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Enable Developer Command Prompt (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Workaround for CMake bug that cannot find __CMAKE::CXX23 target when using homebrew libc++ (macOS) | |
if: ${{ runner.os == 'macOS' }} | |
run: sed -i '' 's|libc++.modules.json|../../c++/libc++.modules.json|g' /opt/homebrew/opt/cmake/share/cmake/Modules/Compiler/Clang-CXX-CXXImportStd.cmake # https://gitlab.kitware.com/cmake/cmake/-/issues/25965#note_1523575 | |
- name: Configure | |
run: | | |
mv .github/workflows/scripts/* . | |
cmake --preset=${{ matrix.os }} | |
- name: Build | |
run: cmake --build build --config release | |
- name: Upload Binary as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}_${{ runner.arch }} | |
path: | | |
build/vk-gltf-viewer.exe | |
build/vk-gltf-viewer.app | |
build/vk-gltf-viewer | |
build/*.dll |