Skip to content

Commit ecf9912

Browse files
committed
v0.8.1: supplement release for 0.8.0 with fixes
- read from assets.zip if avaiable - dengitor launch scripts - fixes some issues that CI wasn't working with github releases - install python stblib - update readme
1 parent 51a968b commit ecf9912

29 files changed

Lines changed: 604 additions & 269 deletions

File tree

.github/workflows/dengine.yml

Lines changed: 116 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,195 @@
11
name: Building dengine libs, dengitor and tests(including apk)
2-
32
on:
43
push:
5-
branches: [ "main" ]
4+
branches:
5+
- main
6+
tags:
7+
- "v*"
68
pull_request:
7-
branches: [ "main" ]
9+
workflow_dispatch:
810

911
jobs:
10-
build_linux:
11-
runs-on: ubuntu-latest
12+
build:
1213
strategy:
1314
fail-fast: true
15+
matrix:
16+
include:
17+
- os: windows-2019
18+
shell: msys2
19+
name: "x86_64_windows"
20+
- os: ubuntu-22.04
21+
shell: bash
22+
name: "x86_64_linux"
23+
runs-on: ${{ matrix.os }}
24+
defaults:
25+
run:
26+
shell: ${{ matrix.shell}} {0}
1427

1528
steps:
16-
- uses: actions/checkout@v3
17-
18-
- name: submodules
19-
run: |
20-
git submodule update --init --depth 1 deps/cglm deps/stb deps/cpython deps/cpython-portable
21-
2229
- name: linux setup and dependencies
30+
if: matrix.name == 'x86_64_linux'
2331
run: |
2432
sudo apt update
25-
sudo apt -y install libgtk-3-dev pkgconf libgl-dev libx11-dev libegl-dev
33+
sudo apt -y install libgtk-3-dev python3-dev pkgconf libgl-dev libx11-dev libegl-dev libbullet-dev
34+
35+
- name: msys2 setup
36+
uses: msys2/setup-msys2@v2
37+
if: matrix.name == 'x86_64_windows'
38+
with:
39+
msystem: UCRT64
40+
update: true
41+
pacboy: gcc gtk3 bullet cmake python
42+
install: git zip
2643

44+
- name: fix crlf
45+
run: git config --global core.autocrlf input
46+
47+
- name: checkout
48+
uses: actions/checkout@v3
49+
50+
- name: submodules
51+
run: |
52+
git submodule update --init --depth 1 deps/cglm deps/stb deps/mingw-ldd deps/ntldd
53+
2754
- name: dengine-rc
2855
run: |
2956
cmake -S main/dengine-rc -B build/dengine-rc
3057
cmake --build build/dengine-rc
3158
32-
- name: linux config, build and install
59+
- name: ${{ matrix.name }} config, build and install
3360
run: |
34-
cmake -S . -B build/linux -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON
35-
cmake --build build/linux -j$(nproc)
36-
cmake --install build/linux --prefix out-linux
61+
cmake -S . -B build/${{ matrix.name }} -DBUILD_SHARED_LIBS=ON
62+
cmake --build build/${{ matrix.name }} -j$(nproc)
63+
cmake --install build/${{ matrix.name }} --prefix out-${{ matrix.name }}
3764
38-
- name: linux build
39-
uses: actions/upload-artifact@v4
40-
with:
41-
name: linux_build
42-
path: out-linux
65+
- name: ${{ matrix.name }} zip
66+
run: |
67+
zip -r ${{ matrix.name }}.zip out-${{ matrix.name }}/
68+
69+
- name: assets zip
70+
if: matrix.name == 'x86_64_linux'
71+
run: |
72+
zip -r assets.zip ./assets
4373
4474
- name: assets package
75+
if: matrix.name == 'x86_64_linux'
4576
uses: actions/upload-artifact@v4
4677
with:
4778
name: assets package
48-
path: ./assets
79+
path: assets.zip
80+
81+
82+
- name: ${{ matrix.name }} build
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: ${{ matrix.name }}_build
86+
path: ${{ matrix.name }}.zip
4987

5088
- name: Set Up JDK
89+
if: matrix.name == 'x86_64_linux'
5190
uses: actions/setup-java@v3
5291
with:
5392
distribution: zulu
54-
java-version: '17'
93+
java-version: '21'
5594
cache: 'gradle'
5695

57-
- name: Change wrapper permissions
96+
- name: test apk
97+
if: matrix.name == 'x86_64_linux'
98+
env:
99+
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
100+
ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
101+
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
58102
run: |
59-
cd tests/src/testdengine-android/apk
103+
git submodule update --init --depth 1 deps/bullet3_src deps/cpython deps/cpython-portable
104+
cd ./tests/src/testdengine-android/apk/
105+
106+
echo "$ANDROID_KEYSTORE" > ks
107+
openssl base64 -A -d -in ks -out ks_dec
108+
echo "storeFile=$(pwd)/ks_dec" > signing.properties
109+
echo "storePassword=$ANDROID_KEYSTORE_PASSWORD" >> signing.properties
110+
echo "keyAlias=$ANDROID_KEYSTORE_ALIAS" >> signing.properties
111+
echo "keyPassword=$ANDROID_KEYSTORE_PASSWORD" >> signing.properties
112+
60113
chmod +x ./gradlew
114+
./gradlew assembleRelease
115+
./gradlew assembleDebug
61116
62-
- name: test apk
117+
- name: zip all apks
118+
if: matrix.name == 'x86_64_linux'
63119
run: |
64-
git submodule update --init --depth 1 deps/bullet3_src
65-
cd ./tests/src/testdengine-android/apk/
66-
./gradlew assembleDebug -x lintVitalAnalyzeRelease -x lintAnalyzeDebug -x lintDebug
120+
zip apks.zip $(find ./tests/src/testdengine-android/apk/app/build/outputs -iname '*.apk')
67121
122+
- name: all_android apks
123+
if: matrix.name == 'x86_64_linux'
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: all_android_apks
127+
path: apks.zip
68128

69129
- name: android build universal
130+
if: matrix.name == 'x86_64_linux'
70131
uses: actions/upload-artifact@v4
71132
with:
72133
name: android_universal_debug
73134
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-universal-debug.apk
74135

75136
- name: android build armebi-v7a
137+
if: matrix.name == 'x86_64_linux'
76138
uses: actions/upload-artifact@v4
77139
with:
78140
name: android_armebi-v7a_debug
79141
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-armeabi-v7a-debug.apk
80142

81143
- name: android build arm64-v8a
144+
if: matrix.name == 'x86_64_linux'
82145
uses: actions/upload-artifact@v4
83146
with:
84147
name: android_arm64-v8a_debug
85148
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
86149

87150
- name: android build x86
151+
if: matrix.name == 'x86_64_linux'
88152
uses: actions/upload-artifact@v4
89153
with:
90154
name: android_x86_debug
91155
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-x86-debug.apk
92156

93157
- name: android build x86_64
158+
if: matrix.name == 'x86_64_linux'
94159
uses: actions/upload-artifact@v4
95160
with:
96161
name: android_x86_64_debug
97162
path: ./tests/src/testdengine-android/apk/app/build/outputs/apk/debug/app-x86_64-debug.apk
98163

99-
build_msys2:
100-
runs-on: windows-latest
101-
strategy:
102-
fail-fast: true
103-
defaults:
104-
run:
105-
shell: msys2 {0}
106-
164+
release:
165+
needs: build
166+
if: startsWith(github.ref, 'refs/tags/')
167+
runs-on: ubuntu-latest
168+
permissions:
169+
contents: write
107170
steps:
108-
- uses: actions/checkout@v3
109-
110-
- uses: msys2/setup-msys2@v2
171+
- name: download all artifacts
172+
uses: actions/download-artifact@v4
111173
with:
112-
msystem: UCRT64
113-
update: true
114-
install: git mingw-w64-ucrt-x86_64-toolchain base-devel mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-gtk3 mingw-w64-ucrt-x86_64-bullet
174+
path: rel
115175

116-
- name: submodules
176+
177+
- name: cleanup
117178
run: |
118-
git submodule update --init --depth 1 deps/stb deps/cglm
179+
rm $(find -iname '*.apk')
180+
unzip -j rel/all_android_apks/apks.zip -d rel
181+
rm rel/all_android_apks/apks.zip
119182
120-
- name: dengine-rc
183+
- name: github sha
121184
run: |
122-
cmake -S main/dengine-rc -B build/dengine-rc
123-
cmake --build build/dengine-rc
185+
echo ${{ github.sha }} > rel/github.sha
124186
125-
- name: configure, build and install msys2
187+
- name: release files list
126188
run: |
127-
cmake -S . -B build/msys2 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON
128-
cmake --build build/msys2 -j$(nproc)
129-
cmake --install build/msys2 --prefix out-msys2
189+
ls rel/**
130190
131-
- name: msys2 build
132-
uses: actions/upload-artifact@v4
191+
- name: GitHub Release
192+
uses: softprops/action-gh-release@v2
133193
with:
134-
name: msys2_build
135-
path: out-msys2
136-
194+
files: |
195+
rel/**

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
url = https://github.com/Denzy7/ntldd
2020
[submodule "deps/mingw-ldd"]
2121
path = deps/mingw-ldd
22-
url = https://github.com/xantares/mingw-ldd
22+
url = https://github.com/nurupo/mingw-ldd

CMakeLists.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.16)
22

3-
project(dengine VERSION 0.8.0)
3+
project(dengine VERSION 0.8.1)
44

55
#this is just a slight nuance with cmake rather than renaming the project
66
set(DENGINE_VERSION "${dengine_VERSION}")
@@ -51,6 +51,7 @@ endif()
5151
find_library(DENGINE_HAS_LIBZ z)
5252
find_library(DENGINE_HAS_EGL EGL)
5353
find_package(PkgConfig QUIET)
54+
5455
if(PkgConfig_FOUND AND NOT ANDROID_NDK)
5556
#link desktop libs
5657
pkg_check_modules(GTK3 gtk+-3.0)
@@ -274,6 +275,28 @@ endforeach()
274275

275276
configure_file(dengine.pc.in dengine.pc @ONLY)
276277

278+
find_program(ZIP_EXECUTABLE zip)
279+
if(NOT ZIP_EXECUTABLE)
280+
message(WARNING "zip not found. reading installed saved assets won't work!")
281+
else()
282+
execute_process(
283+
COMMAND git ls-files assets
284+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
285+
OUTPUT_VARIABLE ASSET_FILES
286+
OUTPUT_STRIP_TRAILING_WHITESPACE
287+
)
288+
string(REPLACE "\n" ";" ASSET_FILE_LIST "${ASSET_FILES}")
289+
add_custom_command(
290+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/assets.zip
291+
DEPENDS ${ASSET_FILE_LIST} #does mean file will have to be committed to reflect in cmake. run cmake twice on new asset??
292+
COMMAND ${ZIP_EXECUTABLE} -r ${CMAKE_CURRENT_BINARY_DIR}/assets.zip . -x priv/\*
293+
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/assets
294+
COMMENT "zipping assets into dengine-utils"
295+
VERBATIM
296+
)
297+
add_custom_target(assets_zip ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/assets.zip)
298+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/assets.zip DESTINATION share/dengine-${DENGINE_VERSION})
299+
endif()
277300
install(FILES ${PROJECT_BINARY_DIR}/dengine_config/dengine_config.h DESTINATION include/dengine-${DENGINE_VERSION}/dengine_config)
278301
install(DIRECTORY deps/glad/include/glad DESTINATION include/dengine-${DENGINE_VERSION}/deps/glad)
279302
install(DIRECTORY deps/glad/include/KHR DESTINATION include/dengine-${DENGINE_VERSION}/deps/glad)

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Change dir to repo:
6363
- **Linux**: Its actually very easy here. Just install the modules located in `<CMAKE_BUILD_DIR>/dengine-script-build/modules-build/python-modules`. Install `dengine` directory to your Python `site-packages` or add the directory to your IDE/Editor Python path (VSCode-OSS in this case)
6464
- **Windows**: You'll probably have to use the stubs. Unless you managed to build everyting with MSVC, which is usually what upstream python is built on
6565

66-
# github actions artifact releases
67-
now availabe on github actions! you need to be logged in
66+
# github releases
67+
- Go to the [Releases page](https://github.com/Denzy7/dengine/releases)
68+
- Preview releases now availabe on github actions! you need to be logged in
6869
[check out the latest succesfull build and download artifacts](https://github.com/Denzy7/dengine/actions/workflows/dengine.yml)
70+
- Releases are only avaiable for x86_64 windows and linux only (aside from android test apk which is available for all architectures)

deps/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Initialize and get default deps. Consider checking optional deps you might also
1919
# optional deps
2020
**If you will be compiling for Windows or Android you might want to get all optional deps to avoid missing libraries and header files**
2121

22-
**If you want Python scripting, update deps/cpython (will take some time!)**
22+
**If you want recompile Python for scripting(usually the case on windows), update deps/cpython (will take some time!)**
2323
`... deps/cpython deps/cpython-portable`
2424

2525
**bullet3 sources only, for cool physics tests (needed to build android apk):**:
2626
`... deps/bullet3_src`
2727

28-
**if you are cross-compiling from linux to mingw, you'll need the local linux system to have python, pip and the relevant submodules***
28+
**if you are cross-compiling from linux to windows with mingw, you'll need the local linux system to have python, pip and the relevant submodules***
2929
`... deps/mingw-ldd deps/ntldd`
3030

3131
# python
@@ -50,7 +50,7 @@ On Linux, Building GTK+ 3 is really complicated. However [some really smart peop
5050
On Windows, you can use the [MSYS2](https://www.msys2.org) toolset to install GTK and build `dengitor`. We'll use `pacboy` to simplyfy
5151
```
5252
pacman -S pactoys git
53-
pacboy -S gcc cmake gtk3
53+
pacboy -S gcc gtk3 bullet cmake python
5454
```
5555

5656
# others

glue/include/dengine/dengine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int dengine_init();
8282
void dengine_terminate();
8383
int dengine_update();
8484
/*!
85-
* \brief load asset to memory
85+
* \brief load asset to memory. mem is heap allocated, so free when done
8686
* \param path path to asset in android apk or file system or assetdir
8787
* \param mem destination of loaded asset in memory
8888
* \param length optional destination length of memory block

0 commit comments

Comments
 (0)