-
-
Notifications
You must be signed in to change notification settings - Fork 140
150 lines (144 loc) · 5.14 KB
/
build.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Build
on: [push, pull_request]
env:
CMAKE_BUILD_TYPE: ${{ github.event_name == 'pull_request' && 'Debug' || 'Release' }}
jobs:
windows:
name: Windows
runs-on: windows-latest
defaults:
run:
shell: cmd
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure
run: cmake -B build -D LOVR_VERSION_HASH=%GITHUB_SHA:~0,6%
- name: Build
run: cmake --build build --config %CMAKE_BUILD_TYPE%
- name: Test
run: build\%CMAKE_BUILD_TYPE%\lovr test
- name: Upload
uses: actions/upload-artifact@v4
with:
name: lovr.exe
path: |
build/Release/lovr.exe
build/Release/lovrc.bat
build/Release/*.dll
linux:
name: Linux
runs-on: ubuntu-20.04
steps:
- name: Update Packages
run: sudo apt update
- name: Install Packages
run: sudo apt install -y xorg-dev libx11-xcb-dev libxcb-glx0-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-xkb-dev libfuse2 libcurl4-openssl-dev libssl-dev
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Init
run: cmake -B build -D LOVR_BUILD_BUNDLE=ON -D LOVR_VERSION_HASH=${GITHUB_SHA::6}
- name: Build
run: cmake --build build -j
- name: Test
run: ./build/bin/lovr test
- name: AppImage
run: >
curl -sOL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage &&
chmod +x ./appimagetool-x86_64.AppImage &&
./appimagetool-x86_64.AppImage build/bin &&
mv LÖVR-x86_64.AppImage lovr-x86_64.AppImage
- name: Upload
uses: actions/upload-artifact@v4
with:
name: lovr.appimage
path: lovr-x86_64.AppImage
android:
name: Android
strategy:
matrix:
abi: [arm64-v8a, x86_64]
runs-on: ubuntu-22.04
steps:
- name: Update Packages
run: sudo apt update
- name: Install Packages
run: sudo apt install -y glslang-tools
- name: Install Android 29
run: ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-29"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Init
run: >
mkdir build &&
cd build &&
keytool
-genkey
-dname 'cn=Unknown, ou=Unknown, o=Unknown, l=Unknown, st=Unknown, c=Unknown'
-keystore key.keystore
-keypass hunter2
-storepass hunter2
-alias key
-keyalg RSA
-keysize 2048
-validity 10000 &&
cmake ..
-D CMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake
-D ANDROID_SDK=$ANDROID_HOME
-D ANDROID_ABI=${{ matrix.abi }}
-D ANDROID_STL=c++_shared
-D ANDROID_NATIVE_API_LEVEL=29
-D ANDROID_BUILD_TOOLS_VERSION=34.0.0
-D ANDROID_KEYSTORE=key.keystore
-D ANDROID_KEYSTORE_PASS=pass:hunter2
-D LOVR_VERSION_HASH=${GITHUB_SHA::6}
- name: Build
run: cmake --build build
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.abi == 'arm64-v8a' && 'lovr.apk' || 'lovr-x64.apk' }}
path: build/lovr.apk
macos:
name: macOS
runs-on: macos-latest
steps:
- name: Install Wulkan
env:
VKV: 1.3.275.0
run: |
curl -sOL https://sdk.lunarg.com/sdk/download/$VKV/mac/vulkansdk-macos-$VKV.dmg?Human=true
hdiutil attach vulkansdk-macos-$VKV.dmg
cp -R /Volumes/vulkansdk-macos-$VKV .
hdiutil detach /Volumes/vulkansdk-macos-$VKV
export VULKAN_SDK=${{ runner.temp }}/vulkan && echo "VULKAN_SDK=$VULKAN_SDK/macOS" >> $GITHUB_ENV
sudo vulkansdk-macos-$VKV/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $VULKAN_SDK --accept-licenses --default-answer --confirm-command install
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Init
run: cmake -B build -D LOVR_BUILD_BUNDLE=ON -D LOVR_VERSION_HASH=${GITHUB_SHA::6}
- name: Build
run: cmake --build build -j
- name: Test
run: ./build/lovr.app/Contents/MacOS/lovr test
- name: Package
run: >
cp $VULKAN_SDK/lib/libvulkan.1.3.275.dylib build/lovr.app/Contents/MacOS/libvulkan.1.dylib &&
cp $VULKAN_SDK/lib/libMoltenVK.dylib build/lovr.app/Contents/MacOS &&
mkdir -p build/lovr.app/Contents/Resources/vulkan/icd.d &&
cp $VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json build/lovr.app/Contents/Resources/vulkan/icd.d &&
sed -i '' 's|../../../lib/libMoltenVK.dylib|../../../MacOS/libMoltenVK.dylib|' build/lovr.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json &&
ditto -c -k --keepParent build/lovr.app lovr.zip
- name: Upload
uses: actions/upload-artifact@v4
with:
name: lovr.app
path: lovr.zip