forked from lyc8503/moonlight-android-no-keyboard-shortcut
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (43 loc) · 1.83 KB
/
android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Android CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Install Android SDK and NDK
run: |
mkdir /home/runner/android && cd /home/runner/android
sudo apt install -y unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
export PATH=$PATH:/home/runner/android/cmdline-tools/bin/
yes | sdkmanager --sdk_root=/home/runner/android "platforms;android-34" "build-tools;34.0.0" "ndk;26.2.11394342"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Update submodules
run: git submodule update --init --recursive
- name: Create local.properties
run: echo "ndk.dir=/home/runner/android/ndk/26.2.11394342" > local.properties
- name: Build with Gradle
run: |
./gradlew assembleNonRootRelease
- name: Sign APK
run: |
keytool -genkey -v -keystore my-release-key.keystore -alias temp_key -keyalg RSA -keysize 2048 -validity 10000 -storepass password -keypass password -dname "CN=GitHubActionsTemporaryKey"
/home/runner/android/build-tools/34.0.0/apksigner sign --ks my-release-key.keystore --ks-key-alias temp_key --ks-pass pass:password --key-pass pass:password --out app-nonRoot-release-signed.apk app/build/outputs/apk/nonRoot/release/app-nonRoot-release-unsigned.apk
- name: Upload APK
uses: actions/[email protected]
with:
name: Moonlight APK
path: app-nonRoot-release-signed.apk