Github action branches #1
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: Rust | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Only allow one concurrency | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_android: | |
| runs-on: ubuntu-latest | |
| if: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| # Steps to build the Rust library | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-ndk | |
| run: cargo install cargo-ndk | |
| - name: Install necessary cargo toolchains | |
| run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android | |
| - name: Find out where the NDK v26 is by looking at the sdk folder | |
| id: setup-ndk | |
| run: echo "ndk-path=$(dirname $(find $ANDROID_HOME/ndk -name 'ndk-gdb' -maxdepth 2 | grep 26))" >> $GITHUB_OUTPUT | |
| # Steps to build the Flutter app | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| - name: Build ANDROID | |
| run: make android | |
| env: | |
| ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| # Steps to upload the APK | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: session-app.apk | |
| path: flutter/build/app/outputs/apk/release/app-release.apk | |
| build_linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Download appimagetool | |
| run: curl -fL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" > appimagetool | |
| - name: Make appimagetool executable | |
| run: chmod +x appimagetool && sudo mkdir -p /usr/local/bin && sudo mv appimagetool /usr/local/bin/appimagetool | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y ninja-build libgtk-3-dev | |
| - name: Build rust and Flutter binaries | |
| run: make linux | |
| env: | |
| CARGO_TERM_COLOR: always | |
| - name: Upload Bundle | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: flutter/build/linux/session-x86_64.AppImage | |
| build_windows: | |
| runs-on: windows-latest | |
| if: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| # Steps to build the Rust library | |
| - name: Build rust binary | |
| run: cargo build --release --target x86_64-pc-windows-msvc | |
| env: | |
| CARGO_TERM_COLOR: always | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| - name: Build Flutter release | |
| run: flutter build windows --release | |
| working-directory: flutter | |
| # Steps to upload the EXE | |
| - name: Upload EXE | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: session-app.exe |