-
Notifications
You must be signed in to change notification settings - Fork 0
220 lines (185 loc) · 6.58 KB
/
Copy pathdengine.yml
File metadata and controls
220 lines (185 loc) · 6.58 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
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
name: Building dengine libs, dengitor and tests(including apk)
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: true
matrix:
include:
- name: "windows_x86_64"
os: windows-2022
shell: msys2
- name: "linux_x86_64"
os: ubuntu-22.04
shell: bash
- name: "android"
os: ubuntu-22.04
shell: bash
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell}} {0}
steps:
- name: linux setup and dependencies
if: matrix.name == 'linux_x86_64'
run: |
sudo apt update
sudo apt -y install libgtk-3-dev python3-dev pkgconf libgl-dev libx11-dev libegl-dev libbullet-dev
- name: msys2 setup
uses: msys2/setup-msys2@v2
if: matrix.name == 'windows_x86_64'
with:
msystem: UCRT64
update: true
pacboy: gcc gtk3 bullet cmake python
install: git zip
- name: fix crlf
run: git config --global core.autocrlf input
- name: checkout
uses: actions/checkout@v3
- name: submodules
run: |
git submodule update --init --depth 1 deps/cglm deps/stb deps/mingw-ldd deps/ntldd
- name: Set Up JDK
if: matrix.name == 'android'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'
cache: 'gradle'
- name: Setup Android SDK
if: matrix.name == 'android'
uses: android-actions/setup-android@v3
- name: Android Sdk packages
if: matrix.name == 'android'
run: |
sdkmanager "cmake;3.30.3" "ndk;23.1.7779620"
- name: dengine-rc
run: |
cmake -S main/dengine-rc -B build/dengine-rc
cmake --build build/dengine-rc
- name: android config
if: matrix.name == 'android'
run: |
if [ -z "$ANDROID_HOME" ]; then
echo "requre $ANDROID_HOME to be set" >&2
exit 1
fi
toolchain="$ANDROID_HOME/ndk/23.1.7779620/build/cmake/android.toolchain.cmake"
cmake -S . -B build/${{ matrix.name }} -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE="$toolchain" -DANDROID_PLATFORM=21 -DDENGINE_SCRIPTING_PYTHON=OFF
- name: ${{ matrix.name }} config
run: |
cmake -S . -B build/${{ matrix.name }} -DBUILD_SHARED_LIBS=ON
- name: ${{ matrix.name }} build and install
run: |
cmake --build build/${{ matrix.name }} -j$(nproc)
cmake --install build/${{ matrix.name }} --prefix out-${{ matrix.name }}
- name: ${{ matrix.name }} zip
run: |
zip -r ${{ matrix.name }}.zip out-${{ matrix.name }}/
- name: assets zip
if: matrix.name == 'linux_x86_64'
run: |
zip -r assets.zip ./assets
- name: assets package
if: matrix.name == 'linux_x86_64'
uses: actions/upload-artifact@v4
with:
name: assets package
path: assets.zip
- name: ${{ matrix.name }} build
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}_build
path: ${{ matrix.name }}.zip
- name: test apk
if: matrix.name == 'android'
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
run: |
git submodule update --init --depth 1 deps/bullet3_src deps/cpython deps/cpython-portable
cd ./tests/src/testdengine-android/apk/
echo "$ANDROID_KEYSTORE" > ks
openssl base64 -A -d -in ks -out ks_dec
echo "storeFile=$(pwd)/ks_dec" > signing.properties
echo "storePassword=$ANDROID_KEYSTORE_PASSWORD" >> signing.properties
echo "keyAlias=$ANDROID_KEYSTORE_ALIAS" >> signing.properties
echo "keyPassword=$ANDROID_KEYSTORE_PASSWORD" >> signing.properties
chmod +x ./gradlew
./gradlew --no-daemon build
- name: zip all apks
if: matrix.name == 'android'
run: |
zip apks.zip $(find ./tests/src/testdengine-android/apk/app/build/outputs -iname '*.apk')
- name: all_android apks
if: matrix.name == 'android'
uses: actions/upload-artifact@v4
with:
name: all_android_apks
path: apks.zip
- name: android build universal
if: matrix.name == 'android'
uses: actions/upload-artifact@v4
with:
name: android_universal_debug
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-universal-debug.apk
- name: android build armebi-v7a
if: matrix.name == 'android'
uses: actions/upload-artifact@v4
with:
name: android_armebi-v7a_debug
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-armeabi-v7a-debug.apk
- name: android build arm64-v8a
if: matrix.name == 'android'
uses: actions/upload-artifact@v4
with:
name: android_arm64-v8a_debug
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
- name: android build x86
if: matrix.name == 'android'
uses: actions/upload-artifact@v4
with:
name: android_x86_debug
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-x86-debug.apk
- name: android build x86_64
if: matrix.name == 'android'
uses: actions/upload-artifact@v4
with:
name: android_x86_64_debug
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-x86_64-debug.apk
release:
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: download all artifacts
uses: actions/download-artifact@v4
with:
path: rel
- name: cleanup
run: |
rm $(find -iname '*.apk')
unzip -j rel/all_android_apks/apks.zip -d rel
rm rel/all_android_apks/apks.zip
- name: github sha
run: |
echo ${{ github.sha }} > rel/github.sha
- name: release files list
run: |
ls rel/**
- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
rel/**