This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
156 lines (127 loc) · 5.38 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
151
152
153
154
155
156
name: Build
on: [ push ]
jobs:
linux:
strategy:
matrix:
configuration: [ Release, Debug ]
name: Linux
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install required packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
version: 1.3.0
packages: >-
build-essential
cmake
ninja-build
libxi-dev
libx11-dev
libxft-dev
libxkbcommon-dev
libegl1-mesa-dev
libgl1-mesa-dev
libglu1-mesa-dev
mesa-common-dev
libxrandr-dev
libxxf86vm-dev
libxaw7-dev
libxext-dev
libwayland-dev
libibus-1.0-dev
libraw-dev
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.*
cache: true
- name: Install development packages via vcpkg
uses: lukka/run-vcpkg@v11
with:
runVcpkgInstall: true
vcpkgGitCommitId: 9d47b24eacbd1cd94f139457ef6cd35e5d92cc84
vcpkgDirectory: ${{ github.workspace }}/vcpkg
- name: Generate Ninja build files
run: cmake -S . -G Ninja -B build -DCI=ON -DCMAKE_BUILD_TYPE=${{ matrix.configuration == 'Release' && 'MinSizeRel' || matrix.configuration }} -DOpenGL_GL_PREFERENCE=GLVND -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Run Ninja build
run: ninja -C build
# ouch - unless and until we start using CMake's install command, these next few steps are a necessary evil
- name: Organize binaries
run: mkdir packaged && mv build/RNR.* packaged
- name: Add RNR resources
run: cp -R Content/RNR packaged/content && cp LICENSE packaged
- name: Add OGRE plugins
run: cp -R build/plugins packaged && cp Content/linux_plugins.cfg packaged/plugins.cfg
- name: Add OGRE shaders
run: cp -R build/shaders packaged && mv packaged/shaders/GLSL/* packaged/shaders && rm -rf packaged/shaders/GLSL
- name: Set output variables
id: vars
run: |
echo "configuration=${{ matrix.configuration }}" | awk '{print tolower($0)}' >> $GITHUB_OUTPUT
echo "hash=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: rnr-${{ steps.vars.outputs.hash }}-linux_x64-${{ steps.vars.outputs.configuration }}
path: packaged
windows:
strategy:
matrix:
include:
- { sys: clang64, env: clang-x86_64 }
configuration: [ Release, Debug ]
name: Windows
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up MSYS2 and install required packages
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
install: >-
mingw-w64-${{ matrix.env }}-${{ matrix.sys == 'clang64' && 'clang' || 'gcc' }}
mingw-w64-${{ matrix.env }}-cmake
mingw-w64-${{ matrix.env }}-ninja
mingw-w64-${{ matrix.env }}-ogre3d
mingw-w64-${{ matrix.env }}-bullet
mingw-w64-${{ matrix.env }}-qt6
mingw-w64-${{ matrix.env }}-boost
mingw-w64-${{ matrix.env }}-pugixml
- name: Generate Ninja build files
run: cmake -S . -G Ninja -B build -DCI=ON -DCMAKE_BUILD_TYPE=${{ matrix.configuration == 'Release' && 'MinSizeRel' || matrix.configuration }}
- name: Run Ninja build
run: ninja -C build
# ouch - unless and until we start using CMake's install command, these next few steps are a necessary evil
- name: Organize binaries
run: mkdir packaged && mv build/*.exe packaged
- name: Add RNR resources
run: cp -R Content/RNR packaged/content && cp LICENSE packaged
- name: Add Qt plugins and dependencies
run: windeployqt6 packaged/*.exe
- name: Add OGRE plugins
run: cp Content/win32_plugins.cfg packaged/plugins.cfg && mkdir packaged/plugins/ && cat packaged/plugins.cfg | grep "Plugin=" | sed -e "s/Plugin=//" | xargs -I '{}' cp -v '/${{ matrix.sys }}/bin/{}.dll' packaged/plugins
- name: Add OGRE shaders
run: mkdir packaged/shaders && cp -R /${{ matrix.sys }}/share/OGRE/Media/Main/* packaged/shaders && cp -R /${{ matrix.sys }}/share/OGRE/Media/RTShaderLib/* packaged/shaders && mv packaged/shaders/GLSL/* packaged/shaders && rm -rf packaged/shaders/GLSL
- name: Add additional runtime dependencies
run: ldd packaged/*.exe | grep "=> /${{ matrix.sys }}/" | awk '{print $3}' | xargs -I '{}' cp -v '{}' packaged
- name: Set output variables
id: vars
run: |
echo "configuration=${{ matrix.configuration }}" | awk '{print tolower($0)}' >> $GITHUB_OUTPUT
echo "hash=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: rnr-${{ steps.vars.outputs.hash }}-win_x64-${{ steps.vars.outputs.configuration }}
path: packaged