Add Android Support #18
Workflow file for this run
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: Build | |
| on: | |
| push: | |
| branches: [ 'main' ] | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| paths: | |
| - client/** | |
| - vodozemac/** | |
| # This job is to build a Windows Installer and will only run on main branch | |
| jobs: | |
| build-windows: | |
| name: Build and Package for Windows | |
| runs-on: windows-2025 | |
| if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '6.9.1' | |
| target: 'desktop' | |
| arch: 'win64_msvc2022_64' | |
| modules: qtmultimedia | |
| cache: 'true' | |
| - name: Install CMake | |
| uses: ssrobins/install-cmake@v1 | |
| with: | |
| version: 4.1.0 | |
| - name: Install OpenSSL | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| curl.exe -O https://slproweb.com/download/Win64OpenSSL_Light-3_6_0.msi | |
| msiexec /package Win64OpenSSL_Light-3_6_0.msi /quiet | |
| - name: Restore Cache LibDataChannel | |
| id: cache-libdatachannel-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: 'C:/Program Files (x86)/libdatachannel' | |
| key: ${{ runner.os }}-libdatachannel | |
| - name: Build LibDataChannel | |
| working-directory: ${{ github.workspace }} | |
| if: steps.cache-libdatachannel-restore.outputs.cache-hit != 'true' | |
| run: | | |
| git clone https://github.com/paullouisageneau/libdatachannel.git | |
| cd libdatachannel | |
| git checkout v0.24.1 | |
| git submodule update --init --recursive --depth 1 | |
| cmake -B build -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DNO_EXAMPLES=ON | |
| cmake --build build --config Release | |
| cmake --install build | |
| - uses: dtolnay/rust-toolchain@stable | |
| name: Install Rust | |
| - name: Build Vodozemac Bindings | |
| working-directory: ${{ github.workspace }}/vodozemac | |
| run: cargo build | |
| - name: Build Sharity | |
| working-directory: ${{ github.workspace }}/client | |
| run: | | |
| cmake -B build -G "Visual Studio 17 2022" -DQt6_DIR="C:\Qt\6.9.1\msvc2022_64" -DCONFIGURE_NSIS=ON -DCMAKE_BUILD_TYPE=Release | |
| cmake --build build --config Release | |
| - uses: winpax/scoop-setup@v1.0.0 | |
| name: Install NSIS | |
| with: | |
| buckets: extras | |
| apps: nsis | |
| - name: Package NSIS | |
| working-directory: ${{ github.workspace }}/client/build | |
| run: cpack . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| path: ${{ github.workspace }}/client/build/Sharity-*-win64.exe | |
| name: 'windows-build' | |
| - name: Save Cache LibDataChannel | |
| id: cache-libdatachannel-save | |
| uses: actions/cache/save@v4 | |
| if: always() && steps.cache-libdatachannel-restore.outputs.cache-hit != 'true' | |
| with: | |
| path: 'C:/Program Files (x86)/libdatachannel' | |
| key: ${{ runner.os }}-libdatachannel | |
| build-linux: | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Dependencies | |
| run: sudo apt update && sudo apt install -y libsrtp2-dev ninja-build | |
| - name: Install CMake | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| mkdir cmake | |
| cd cmake | |
| curl -LO https://github.com/Kitware/CMake/releases/download/v4.1.0/cmake-4.1.0-linux-x86_64.sh | |
| chmod +x cmake-4.1.0-linux-x86_64.sh | |
| ./cmake-4.1.0-linux-x86_64.sh --skip-license | |
| rm cmake-4.1.0-linux-x86_64.sh | |
| echo "$(pwd)/bin" >> $GITHUB_PATH | |
| - uses: dtolnay/rust-toolchain@stable | |
| name: Install Rust | |
| - uses: jurplel/install-qt-action@v4 | |
| name: Install Qt | |
| with: | |
| host: linux | |
| modules: qtmultimedia | |
| version: '6.10.1' | |
| dir: ${{ github.workspace }} | |
| - name: Cache LibDataChannel | |
| id: cache-libdatachannel | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/libdatachannel | |
| key: ${{ runner.os }}-libdatachannel | |
| - name: Build LibDataChannel | |
| working-directory: ${{ github.workspace }} | |
| if: steps.cache-libdatachannel.outputs.cache-hit != 'true' | |
| run: | | |
| git clone https://github.com/paullouisageneau/libdatachannel.git | |
| cd libdatachannel | |
| git checkout | |
| git checkout v0.24.1 | |
| git submodule update --init --recursive --depth 1 | |
| cmake -B build -GNinja -DNO_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_SRTP=ON | |
| cmake --build build | |
| - name: Install LibDataChannel | |
| working-directory: ${{ github.workspace }}/libdatachannel | |
| run: sudo cmake --install build | |
| - uses: dtolnay/rust-toolchain@stable | |
| name: Install Rust | |
| - name: Build Vodozemac | |
| working-directory: ${{ github.workspace }}/vodozemac | |
| run: cargo build | |
| - name: Build Sharity | |
| working-directory: ${{ github.workspace }}/client | |
| run: | | |
| cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release | |
| cmake --build build | |
| build-android: | |
| name: Build Android | |
| runs-on: ubuntu-latest | |
| env: | |
| QT_VERSION: '6.10.1' | |
| NDK_VERSION: '29.0.13846066' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: jurplel/install-qt-action@v4 | |
| name: Install Qt | |
| with: | |
| host: linux | |
| target: android | |
| modules: qtmultimedia | |
| arch: android_arm64_v8a | |
| version: ${{ env.QT_VERSION }} | |
| dir: ${{ github.workspace }} | |
| - uses: dtolnay/rust-toolchain@stable | |
| name: Install Rust | |
| with: | |
| target: aarch64-linux-android | |
| - name: Install cargo-ndk | |
| run: cargo install cargo-ndk | |
| - name: Install CMake | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| mkdir cmake | |
| cd cmake | |
| curl -LO https://github.com/Kitware/CMake/releases/download/v4.1.0/cmake-4.1.0-linux-x86_64.sh | |
| chmod +x cmake-4.1.0-linux-x86_64.sh | |
| ./cmake-4.1.0-linux-x86_64.sh --skip-license | |
| rm cmake-4.1.0-linux-x86_64.sh | |
| echo "$(pwd)/bin" >> $GITHUB_PATH | |
| - name: Install Ninja | |
| run: sudo apt update && sudo apt install -y ninja-build | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Android | |
| uses: android-actions/setup-android@v3 | |
| with: | |
| log-accepted-android-sdk-licenses: false | |
| - name: Install Android Tools | |
| run: | | |
| yes | sdkmanager --install "ndk;${NDK_VERSION}" | |
| yes | sdkmanager --install "build-tools;36.1.0" | |
| yes | sdkmanager --install "platforms;android-36" | |
| echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}" >> $GITHUB_ENV | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}" >> $GITHUB_ENV | |
| - name: Cache Android Libraries | |
| id: cache-android-libs | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/android-libraries | |
| key: android-libraries | |
| - name: Build Android Libraries | |
| if: steps.cache-android-libs.outputs.cache-hit != 'true' | |
| run: ANDROID_SIGN="" BUILD_RELEASE="" ANDROID_SDK="${ANDROID_SDK_ROOT}" ANDROID_NDK="${ANDROID_NDK_ROOT}" ANDROID_QT="${GITHUB_WORKSPACE}/Qt/${QT_VERSION}/android_arm64_v8a" ./setup-android.sh | |
| - name: Setup Android Environment | |
| if: steps.cache-android-libs.outputs.cache-hit == 'true' | |
| run: SKIP_LIBRARIES="" ANDROID_SIGN="" BUILD_RELEASE="" ANDROID_SDK="${ANDROID_SDK_ROOT}" ANDROID_NDK="${ANDROID_NDK_ROOT}" ANDROID_QT="${GITHUB_WORKSPACE}/Qt/${QT_VERSION}/android_arm64_v8a" ./setup-android.sh | |
| - name: Create Debug Keystore | |
| run: | | |
| mkdir $HOME/.android | |
| keytool -genkeypair \ | |
| -keystore $HOME/.android/debug.keystore \ | |
| -storepass android \ | |
| -keypass android \ | |
| -alias androiddebugkey \ | |
| -keyalg RSA \ | |
| -keysize 2048 \ | |
| -validity 10000 \ | |
| -dname "CN=Android Debug,O=Android,C=US" | |
| - name: Build Vodozemac | |
| working-directory: ${{ github.workspace }}/vodozemac | |
| run: cargo build | |
| - name: Build Sharity | |
| working-directory: ${{ github.workspace }}/client | |
| run: | | |
| source android-env | |
| export QT_ANDROID_KEYSTORE_PATH=$HOME/.android/debug.keystore | |
| export QT_ANDROID_KEYSTORE_ALIAS=androiddebugkey | |
| export QT_ANDROID_KEYSTORE_STORE_PASS=android | |
| export QT_ANDROID_KEYSTORE_KEY_PASS=android | |
| ./configure-android.sh | |
| cmake --build build-android --target apk | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| path: ${{ github.workspace }}/client/build-android/android-build/sharity-client.apk | |
| name: 'android-build' |