Skip to content

Build DirectXTex Libraries #6

Build DirectXTex Libraries

Build DirectXTex Libraries #6

name: Build DirectXTex Libraries
on: [workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# - os: ubuntu-latest
# arch: x86_64
# - os: ubuntu-latest
# arch: arm64
# - os: windows-latest
# arch: x86_64
# - os: windows-latest
# arch: x86
# - os: windows-latest
# arch: arm64
- os: macos-latest
arch: x86_64
- os: macos-latest
arch: arm64
steps:
- uses: actions/[email protected]
with:
repository: 'HexaEngine/Hexa.NET.DirectXTex'
path: 'DirectXTex'
submodules: true
- name: CD into working folder
run: cd Hexa.NET.DirectXTex/DirectXTex
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
run: |
brew update
brew install cmake
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
- name: Install DirectX 12 headers and DirectXMath
run: |
./vcpkg/vcpkg install directx-headers --allow-unsupported
./vcpkg/vcpkg install directxmath --allow-unsupported
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
- name: Configure DirectXTex with CMake for macOS ARM64
if: matrix.arch == 'arm64' && matrix.os == 'macos-latest'
run: cmake -S . -B ./build -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_DX12=OFF -DENABLE_DX11=OFF
- name: Configure DirectXTex with CMake for macOS
if: matrix.arch != 'arm64' && matrix.os == 'macos-latest'
run: cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_DX12=OFF -DENABLE_DX11=OFF
- name: Configure DirectXTex with CMake
if: matrix.os != 'macos-latest'
run: cmake -S . -B ./build -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build DirectXTex
run: cmake --build . --config Release
- name: Upload Artifacts
uses: actions/[email protected]
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-artifacts
path: |
./build/Release/*.dll
./build/*.so
./build/*.dylib
if-no-files-found: ignore # 'warn' or 'ignore' or 'error'