1+ name : Rust
2+
3+ on :
4+ push :
5+ branches : [ "master" ]
6+ pull_request :
7+ branches : [ "master" ]
8+
9+ env :
10+ CARGO_TERM_COLOR : always
11+
12+ # Only allow one concurrency
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.ref }}
15+ cancel-in-progress : true
16+
17+ jobs :
18+ build_android :
19+ runs-on : ubuntu-latest
20+ if : false
21+ steps :
22+ - uses : actions/checkout@v4
23+ with :
24+ submodules : recursive
25+
26+ # Steps to build the Rust library
27+ - uses : Swatinem/rust-cache@v2
28+ - name : Install cargo-ndk
29+ run : cargo install cargo-ndk
30+ - name : Install necessary cargo toolchains
31+ run : rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
32+ - name : Find out where the NDK v26 is by looking at the sdk folder
33+ id : setup-ndk
34+ run : echo "ndk-path=$(dirname $(find $ANDROID_HOME/ndk -name 'ndk-gdb' -maxdepth 2 | grep 26))" >> $GITHUB_OUTPUT
35+ # Steps to build the Flutter app
36+ - name : Set up JDK 17
37+ uses : actions/setup-java@v4
38+ with :
39+ java-version : ' 17'
40+ distribution : ' temurin'
41+
42+ - name : Set up Flutter
43+ uses : subosito/flutter-action@v2
44+ with :
45+ channel : stable
46+ cache : true
47+
48+ - name : Build ANDROID
49+ run : make android
50+ env :
51+ ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
52+ ANDROID_NDK_ROOT : ${{ steps.setup-ndk.outputs.ndk-path }}
53+
54+ # Steps to upload the APK
55+ - name : Upload APK
56+ uses : actions/upload-artifact@v4
57+ with :
58+ name : session-app.apk
59+ path : flutter/build/app/outputs/apk/release/app-release.apk
60+
61+ build_linux :
62+ runs-on : ubuntu-latest
63+ steps :
64+ - uses : actions/checkout@v4
65+ with :
66+ submodules : recursive
67+ - uses : Swatinem/rust-cache@v2
68+ - name : Download appimagetool
69+ run : curl -fL "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" > appimagetool
70+ - name : Make appimagetool executable
71+ run : chmod +x appimagetool && sudo mkdir -p /usr/local/bin && sudo mv appimagetool /usr/local/bin/appimagetool
72+ - name : Set up Flutter
73+ uses : subosito/flutter-action@v2
74+ with :
75+ channel : stable
76+ cache : true
77+ - name : Install dependencies
78+ run : |
79+ sudo apt-get update -y
80+ sudo apt-get install -y ninja-build libgtk-3-dev
81+ - name : Build rust and Flutter binaries
82+ run : make linux
83+ env :
84+ CARGO_TERM_COLOR : always
85+ - name : Upload Bundle
86+ uses : actions/upload-artifact@v4
87+ with :
88+ path : flutter/build/linux/session-x86_64.AppImage
89+
90+ build_windows :
91+ runs-on : windows-latest
92+ if : false
93+ steps :
94+ - uses : actions/checkout@v4
95+ with :
96+ submodules : recursive
97+
98+ # Steps to build the Rust library
99+ - name : Build rust binary
100+ run : cargo build --release --target x86_64-pc-windows-msvc
101+ env :
102+ CARGO_TERM_COLOR : always
103+
104+ - name : Set up Flutter
105+ uses : subosito/flutter-action@v2
106+ with :
107+ channel : stable
108+ cache : true
109+
110+ - name : Build Flutter release
111+ run : flutter build windows --release
112+ working-directory : flutter
113+
114+ # Steps to upload the EXE
115+ - name : Upload EXE
116+ uses : actions/upload-artifact@v4
117+ with :
118+ name : session-app.exe
0 commit comments