Build and upload release on multiple platforms #24
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 and upload release on multiple platforms | |
on: | |
workflow_dispatch: | |
jobs: | |
# release-windows: | |
# runs-on: windows-latest | |
# name: Build on Windows-latest | |
# steps: | |
# #checkout code | |
# - name: Checkout code | |
# id: checkout_code | |
# uses: actions/checkout@v4 | |
# | |
# #Setup Vulkan SDK | |
# - name: Install Vulkan SDK | |
# uses: humbletim/[email protected] | |
# with: | |
# version: latest | |
# cache: true | |
# | |
# #Locate MSBuild.eze and add to PATH | |
# - name: Add MSBuild to PATH | |
# id: setup_msbuild | |
# uses: microsoft/setup-msbuild@v2 | |
# with: | |
# msbuild-architecture: x64 | |
# | |
# #Run MSBuild Release | |
# - name: Run MSBuild Release | |
# id: run_msbuild_release | |
# working-directory: .\ | |
# run: msbuild.exe .\ -t:VulVoxOptimizationProject -property:Configuration=Release -property:Platform=x64 | |
# | |
# #Upload release build as artifact | |
# - uses: actions/upload-artifact@v4 | |
# with: | |
# name: windows-release-artifact | |
# path: x64/Release | |
# | |
release-macOS: | |
runs-on: macos-latest | |
name: Build on MacOS-latest | |
env: | |
VULKAN_SDK_VERSION: "" | |
VULKAN_SDK: "" | |
VERSION_URL: "https://vulkan.lunarg.com/sdk/latest/mac.txt" | |
SDK_URL: "" | |
steps: | |
#checkout code | |
- name: Checkout code | |
id: checkout_code | |
uses: actions/checkout@v4 | |
#Setup Vulkan SDK | |
- name: Check Vulkan SDK Version | |
shell: bash | |
run: | | |
echo "retrieving latest version from url: $VERSION_URL" | |
VULKAN_SDK_VERSION=$(curl -sL $VERSION_URL) | |
echo "latest version for MacOS is: $VULKAN_SDK_VERSION" | |
basedir=$PWD | |
echo "VULKAN_SDK=-$basedir/VULKAN_SDK" >> $GITHUB_ENV | |
echo "VULKAN_SDK_VERSION=$VULKAN_SDK_VERSION" >> $GITHUB_ENV | |
- name: Download Vulkan SDK | |
shell: bash | |
run: | | |
VULKAN_SDK_VERSION=${{env.VULKAN_SDK_VERSION}} | |
SDK_URL="https://sdk.lunarg.com/sdk/download/$VULKAN_SDK_VERSION/mac/vulkan_sdk.dmg?Human=true" | |
VERSION_URL= ${{env.VERSION_URL}} | |
echo "SDK_URL=$SDK_URL" >> $GITHUB_ENV | |
echo "Downloading Vulkan SDK $VULKAN_SDK_VERSION from $SDK_URL" | |
curl --fail-with-body -s -L -o vulkan_sdk.dmg.tmp $SDK_URL || { echo "curl failed with error code: $?" >&2 ; curl -s -L --head $VERSION_URL >&2 ; exit 32 ; } | |
test -f vulkan_sdk.dmg.tmp | |
mv -v vulkan_sdk.dmg.tmp vulkan_sdk.dmg | |
ls -lh vulkan_sdk.dmg >&2 | |
- name: Install Vulkan SDK | |
shell: bash | |
run: | | |
VULKAN_SDK=${{env.VULKAN_SDK}} | |
echo $(test -d $VULKAN_SDK && test -f vulkan_sdk.dmg) | |
file vulkan_sdk.dmg | |
MOUNTPOINT=$(hdiutil attach vulkan_sdk.dmg -verbose | grep -i vulkansdk | awk 'END {print $NF}') | |
echo "Installing from mountpoint: $MOUNTPOINT" | |
sudo $MOUNTPOINT/InstallVulkan.app/Contents/MacOS/InstallVulkan --root "$VULKAN_SDK" --accept-licenses --default-answer --confirm-command install | |
du -hs $VULKAN_SDK | |
- name: Install glfw | |
run: brew install glfw | |
- name: Create build directory | |
run: cmake -S VulVoxOptimizationProject/ -B build/ -D CMAKE_BUILD_TYPE=Release | |
- name: Build project | |
run: cmake --build build/ --config Release |