1+ name : Build EHoRY
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+
7+ env :
8+ CARGO_NET_GIT_FETCH_WITH_CLI : true
9+ CARGO_TERM_COLOR : always
10+ UPLOAD_TG : true
11+
12+ jobs :
13+ build-aarch64 :
14+ name : Build for AArch64 Linux
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v3
20+
21+ - name : Setup Android SDK
22+ uses : android-actions/setup-android@v2
23+
24+ - name : Setup Android NDK
25+ run : $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;29.0.14206865"
26+
27+ - name : Setup Rust
28+ uses : actions-rust-lang/setup-rust-toolchain@v1
29+ with :
30+ target : aarch64-linux-android
31+
32+ - name : Install cargo-ndk
33+ run : cargo install cargo-ndk
34+
35+ - name : Install cross-compilation tools
36+ run : |
37+ sudo apt-get update
38+ sudo apt-get install -y upx coreutils python3
39+
40+ - name : Build for AArch64
41+ run : |
42+ cd rshy
43+ cargo ndk --target aarch64-linux-android build --release
44+ cargo build --bin encoder
45+ upx --best --lzma /home/runner/work/EHoRY/EHoRY/rshy/target/aarch64-linux-android/release/rshy
46+ /home/runner/work/EHoRY/EHoRY/rshy/target/debug/encoder /home/runner/work/EHoRY/EHoRY/rshy/target/aarch64-linux-android/release/rshy rshy.data
47+ cat ../EHoRY.sh rshy.data > EHoRY.sh
48+ gzexe EHoRY.sh
49+ chmod +x EHoRY.sh
50+
51+ - name : Cache cargo registry and build artifacts
52+ if : always()
53+ uses : actions/cache@v3
54+ with :
55+ path : |
56+ .cargo/registry
57+ .cargo/git
58+ /home/runner/work/EHoRY/EHoRY/rshy/target/aarch64-linux-android
59+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
60+ restore-keys : |
61+ ${{ runner.os }}-cargo-
62+
63+ - name : Upload binary artifact
64+ uses : actions/upload-artifact@v4
65+ with :
66+ name : EHoRY
67+ path : rshy/EHoRY.sh
68+ retention-days : 7
69+
70+ - name : Bot session cache
71+ if : env.UPLOAD_TG == 'true'
72+ id : bot_session_cache
73+ uses : actions/cache@v4
74+ with :
75+ path : scripts/kernelbot.session
76+ key : ${{ runner.os }}-bot-session
77+
78+ - name : Upload to telegram
79+ if : env.UPLOAD_TG == 'true'
80+ env :
81+ CHAT_ID : ${{ vars.CHAT_ID }}
82+ BOT_TOKEN : ${{ secrets.BOT_TOKEN }}
83+ COMMIT_MESSAGE : ${{ github.event.head_commit.message }}
84+ COMMIT_URL : ${{ github.event.head_commit.url }}
85+ RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
86+ REPOSITORY : ${{ github.repository }}
87+ AUTHOR : ${{ github.event.head_commit.author.name }}
88+ MESSAGE_THREAD_ID : 9
89+ shell : bash
90+ run : |
91+ if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
92+ pip3 install telethon
93+ export NTIME=$(date '+%Y-%m-%d %H:%M:%S')
94+ python3 $GITHUB_WORKSPACE/scripts/kernelbot.py $GITHUB_WORKSPACE/rshy/EHoRY.sh
95+ fi
0 commit comments