fix and turn on compiler warnings #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/** |