Skip to content

adjust to the merged changes #114

adjust to the merged changes

adjust to the merged changes #114

Workflow file for this run

name: Build Release
on:
workflow_dispatch:
push:
branches:
- "**"
pull_request:
branches: [ "main" ]
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- id: win-msvc
name: Windows MSVC
os: windows-latest
cmake-platform-args: -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -G "Visual Studio 17 2022"
- id: win-llvm
name: Windows LLVM
os: windows-latest
cmake-platform-args: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G Ninja
- id: mac
name: MacOS
os: macos-latest
cmake-platform-args: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G Ninja
- id: linux
name: Linux
os: ubuntu-latest
cmake-platform-args: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G Ninja
name: Build ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v4
- name: Install Latest LLVM on Windows
if: matrix.config.id == 'win-llvm'
run: |
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.7/LLVM-20.1.7-win64.exe" -OutFile llvm.exe
7z x llvm.exe -o"C:\Program Files\Latest LLVM"
echo "C:\Program Files\Latest LLVM\bin" >> $env:GITHUB_PATH
- name: Install Linux dependencies
if: matrix.config.id == 'linux'
run: sudo apt-get install -y libx11-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libgl1-mesa-dev libglu1-mesa-dev
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build ${{ matrix.config.cmake-platform-args }} -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cmake --build ${{ github.workspace }}/build --config Release
- name: Upload
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.config.id }}
path: ${{ github.workspace }}/bin/*
cleanup:
name: Cleanup
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download build outputs
uses: actions/download-artifact@v4
- name: Organize
run: |
if [ -d "build-win-msvc/resources" ]; then
mv build-win-msvc/resources .
rm -rf */resources
cd resources && zip -r ../resources.zip * && cd ..
fi
cd build-win-msvc && zip -r ../Windows-MSVC.zip *
cd ../build-win-llvm && zip -r ../Windows-LLVM.zip *
cd ../build-mac && zip -r ../MacOS.zip *
cd ../build-linux && zip -r ../Linux.zip *
- name: Upload new zips
uses: actions/upload-artifact@v4
with:
path: '*.zip'
name: Build outputs
win-msi:
name: Build Windows installer
needs: cleanup
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install WiX toolset
run: |
curl.exe -LO https://github.com/wixtoolset/wix/releases/download/v6.0.1/wix-cli-x64.msi
msiexec /i wix-cli-x64.msi /quiet
- name: Download zips
uses: actions/download-artifact@v4
with:
name: Build outputs
- name: Build installer
run: |
7z x Windows-MSVC.zip -o${{ github.ref_name }}
if (Test-Path -Path resources.zip) {
7z x resources.zip -o${{ github.ref_name }}/resources
}
del *.zip
powershell -ExecutionPolicy Bypass -File .\.github\scripts\build-msi.ps1 `
-SourceDir .\${{ github.ref_name }} `
-AppName "${{ github.ref_name }}" `
-Manufacturer "Johnny Cena" `
-Version "1.1.0" `
-OutputMsi "${{ github.ref_name }}.msi"
- name: Upload installer
uses: actions/upload-artifact@v4
with:
path: ${{ github.ref_name }}.msi
name: Windows .msi installer
publish:
name: Publish
permissions:
contents: write
needs: win-msi
runs-on: ubuntu-latest
steps:
- name: Download Windows .msi installer
uses: actions/download-artifact@v4
with:
name: Windows .msi installer
- name: Download zips
uses: actions/download-artifact@v4
with:
name: Build outputs
- name: Prepare
run: |
mv Windows-MSVC.zip Windows.zip
rm Windows-LLVM.zip
- name: Create release
if: github.ref_name != 'Template' && github.ref_name != 'github-actions'
uses: softprops/action-gh-release@v2
with:
tag_name: nightly-${{ github.ref_name }}
name: Development build for ${{ github.ref_name }}
body: |
Build triggered by commit ${{ github.sha }} on branch ${{ github.ref_name }}.
This is a build of the **latest commit**, it is not guaranteed to be stable.
draft: false
prerelease: true
files: |
${{ github.ref_name }}.msi
*.zip