-
Notifications
You must be signed in to change notification settings - Fork 7
86 lines (71 loc) · 3.4 KB
/
build.yml
File metadata and controls
86 lines (71 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build
on:
push:
paths:
- '**'
- '!README.md'
- '!LICENSE.txt'
- '!docs/**'
env:
FEED_URL: "https://nuget.pkg.github.com/stripe2933/index.json"
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/stripe2933/index.json,readwrite"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: 'windows-latest', compiler: 'msvc' }
- { os: 'windows-latest', compiler: 'mingw-clang' }
- { os: 'macos-latest', compiler: 'clang' }
- { os: 'ubuntu-latest', compiler: 'clang' }
steps:
- uses: actions/checkout@v4
- name: Install MinGW Clang (Windows + MinGW Clang)
if: ${{ runner.os == 'Windows' && matrix.compiler == 'mingw-clang' }}
run: C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -S mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-libc++ mingw-w64-clang-x86_64-libwinpthread-git'
- name: Install build dependencies (macOS)
if: ${{ runner.os == 'macOS' }}
run: brew install llvm mono autoconf automake libtool nasm molten-vk
- name: Install build dependencies (Linux)
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install clang-19 clang-tools-19 libc++-19-dev libc++abi-19-dev mono-devel xorg-dev autoconf autoconf-archive automake libtool libltdl-dev
- name: Enable Developer Command Prompt (Windows + MSVC)
if: ${{ runner.os == 'Windows' && matrix.compiler == 'msvc' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Workaround C++ standard library module bug (macOS)
if: ${{ runner.os == 'macOS' }}
run: |
ln -s /opt/homebrew/etc/clang ~/.config/clang
sed -i '' 's|-print-file-name=${_clang_modules_json_impl}.modules.json|-print-file-name=../../c++/${_clang_modules_json_impl}.modules.json|g' /opt/homebrew/opt/cmake/share/cmake/Modules/Compiler/Clang-CXX-CXXImportStd.cmake # https://github.com/llvm/llvm-project/issues/109895
- name: Add NuGet sources (Windows)
if: ${{ runner.os == 'Windows' }}
shell: pwsh
run: |
.$(vcpkg fetch nuget) sources add -Source "${{ env.FEED_URL }}" -Name GitHubPackages -UserName "stripe2933" -Password "${{ secrets.GH_PACKAGES_TOKEN }}"
.$(vcpkg fetch nuget) setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" -Source "${{ env.FEED_URL }}"
- name: Add NuGet sources (macOS, Linux)
if: ${{ runner.os == 'macOS' || runner.os == 'Linux' }}
shell: bash
run: |
mono `vcpkg fetch nuget | tail -n 1` sources add -Source "${{ env.FEED_URL }}" -Name GitHubPackages -UserName "stripe2933" -Password "${{ secrets.GH_PACKAGES_TOKEN }}"
mono `vcpkg fetch nuget | tail -n 1` setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" -Source "${{ env.FEED_URL }}"
- name: Configure
run: |
vcpkg add port cgal ktx openexr
mv .github/workflows/scripts/* .
cmake --preset=${{ matrix.os }}-${{ matrix.compiler }}
- name: Build
run: cmake --build build --config release
- name: Upload Binary as Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}_${{ runner.arch }}_${{ matrix.compiler }}
path: |
build/vk-gltf-viewer.exe
build/vk-gltf-viewer.app
build/vk-gltf-viewer
build/*.dll