forked from DrBeef/QuestZDoom
-
-
Notifications
You must be signed in to change notification settings - Fork 0
237 lines (205 loc) · 7.61 KB
/
build.yaml
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: Continuous Integration
on:
pull_request:
push:
tags:
- '*'
paths-ignore:
- '**/README.md'
- '**/LICENSE'
# branches:
# - master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: ${{ matrix.name }} | ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022]
build_type: [Release, Debug]
include:
- progdir: Projects/Android
- ndk: 21.4.7075529
- build_type: Release
build_folder: release
- build_type: Debug
build_folder: debug
- os: windows-2022
name: Visual Studio 2022
extra_options: -A x64
- os: ubuntu-22.04
name: Linux GCC 12
deps_cmdline: "sudo apt update && sudo apt install libsdl2-dev libvpx-dev libgtk-3-dev libwebp-dev"
extra_options: "-DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12"
steps:
# - name: Checkout SDK Mobile
# uses: actions/checkout@v3
# with:
# repository: emawind84/ovr_sdk_mobile
# token: ${{ secrets.GH_PAT }}
# path: ''
- name: Checkout QuestZDoom
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
path: ''
- run: git fetch --deepen=100
working-directory: ${{ matrix.progdir }}/jni/gzdoom-g3.3mgw_mobile
- name: Checkout SDK Mobile
uses: actions/checkout@v3
with:
fetch-depth: 1
repository: emawind84/ovr_sdk_mobile_dist
path: 'sdk'
- name: Checkout META SDK Native Libraries
run: 7z x ovr_openxr_mobile_sdk_47.0.zip -ometasdk
working-directory: sdk
- name: Prepare META SDK Native Libraries
shell: bash
run: >
mv sdk/metasdk/OpenXR/Libs/Android/arm64-v8a/Release/libopenxr_loader.so
Projects/Android/libs/arm64-v8a/libopenxr_loader_meta.so
- name: Checkout PICO SDK Native Libraries
run: 7z x Pico_OpenXR_SDK_v210.zip -opicosdk
working-directory: sdk
- name: Prepare PICO SDK Libraries
shell: bash
run: >
mv sdk/picosdk/libs/android.arm64-v8a/libopenxr_loader.so
Projects/Android/libs/arm64-v8a/libopenxr_loader_pico.so
# - uses: actions/cache@v3
# with:
# path: |
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
if: runner.os == 'Windows'
with:
vcpkgDirectory: '${{ github.workspace }}/build/vcpkg'
vcpkgGitCommitId: '2c401863dd54a640aeb26ed736c55489c079323b'
- name: Setup environment
if: runner.os == 'Windows'
shell: bash
run: echo CMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV
- name: Install Dependencies
shell: bash
run: |
if [[ -n "${{ matrix.deps_cmdline }}" ]]; then
eval ${{ matrix.deps_cmdline }}
fi
- name: Install ZMusic
shell: bash
run: |
cmake -B zmusic_build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=`pwd`/zmusic_install ZMusic
cmake --build zmusic_build --target install --parallel 3
working-directory: ${{ matrix.progdir }}/jni/SupportLibs
- name: Configure CMAKE
shell: bash
run: >
cmake -B build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_PREFIX_PATH=`pwd`/../SupportLibs/zmusic_install
-DPK3_QUIET_ZIPDIR=ON ${{ matrix.extra_options }}
.
working-directory: ${{ matrix.progdir }}/jni/gzdoom-g3.3mgw_mobile
- name: Prepare PK3 packages
shell: bash
run: |
cmake --build build \
--config ${{ matrix.build_type }} \
--target qzdoom_pk3 lights_pk3 game_support_pk3 \
--parallel 3
mkdir -p ../../../../assets/res
cp build/*.pk3 ../../../../assets/res
working-directory: ${{ matrix.progdir }}/jni/gzdoom-g3.3mgw_mobile
- name: Revision update
shell: bash
run: cmake --build build --config ${{ matrix.build_type }} --target revision_check
working-directory: ${{ matrix.progdir }}/jni/gzdoom-g3.3mgw_mobile
- name: Setup NDK for Ubuntu
if: runner.os == 'Linux'
shell: bash
run: echo "y" | ${{ env.SDKMANAGER }} "ndk;${{ matrix.ndk }}"
env:
SDKMANAGER: ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
- name: Setup NDK for Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$sdkRoot = "C:\Android\android-sdk"
$sdkManager = "$sdkRoot\cmdline-tools\latest\bin\sdkmanager.bat"
& $sdkManager --sdk_root=$sdkRoot "ndk;${{ matrix.ndk }}"
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
architecture: x64
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup gradle
uses: gradle/gradle-build-action@v2
with:
build-root-directory: ${{ matrix.progdir }}
cache-read-only: true
cache-disabled: false
- name: Set execution flag for gradlew
shell: bash
run: chmod +x gradlew
working-directory: ${{ matrix.progdir }}
- name: Build with gradle
id: gradle_build
shell: bash
run: ./gradlew :Projects:Android:assemble${{ matrix.build_type }}
working-directory: ${{ matrix.progdir }}
- name: Sign app APK
if: matrix.build_type == 'Release'
uses: ilharp/sign-android-release@v1
id: sign_app_apk
with:
releaseDir: ${{ matrix.progdir }}/build/outputs/apk/release
signingKey: ${{ secrets.SIGNING_KEY }}
keyAlias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
buildToolsVersion: 33.0.0
- name: Prepare signed APK
shell: bash
run: mv --force '${{steps.sign_app_apk.outputs.signedFile}}' questzdoom-${{ matrix.build_folder }}.apk
if: ${{ steps.sign_app_apk.outcome == 'success' }}
working-directory: ${{ matrix.progdir }}/build/outputs/apk/${{ matrix.build_folder }}
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }} ${{ matrix.build_type }}
path: ${{ matrix.progdir }}/build/outputs/apk/${{ matrix.build_folder }}/*-${{ matrix.build_folder }}.apk
if-no-files-found: error
retention-days: 30
- name: Prepare package for release
if: runner.os == 'Linux'
uses: actions/download-artifact@v3
with:
name: ${{ matrix.name }} ${{ matrix.build_type }}
path: release
- name: Display structure of release files
if: runner.os == 'Linux'
shell: bash
run: ls -R
working-directory: release
- name: Prepare release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
draft: true
files: |
release/*.apk
LICENSE.txt