Skip to content

Commit 81a07b7

Browse files
committed
Added github workflow and added nightly build plus pre-release
1 parent f10085f commit 81a07b7

2 files changed

Lines changed: 120 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: moonlight-android
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: Build
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: android-actions/setup-android@v3
12+
with:
13+
cmdline-tools-version: 9477386
14+
15+
- uses: actions/setup-java@v4
16+
with:
17+
java-version: 21
18+
distribution: 'adopt'
19+
20+
- name: Set up environment
21+
run: |
22+
echo "ANDROID_NDK_HOME=$ANDROID_NDK_HOME" >> $GITHUB_ENV
23+
echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> $GITHUB_ENV
24+
echo "COMMIT_PREFIX=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
25+
26+
- name: Checkout moonlight-android repo
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Decode debug keystore
32+
env:
33+
DEBUG_KEYSTORE: ${{ secrets.DEBUG_KEYSTORE }}
34+
run: |
35+
if [ -z "$DEBUG_KEYSTORE" ]
36+
then
37+
echo "No debug keystore value"
38+
else
39+
echo $DEBUG_KEYSTORE > debug.keystore.base64
40+
base64 --decode debug.keystore.base64 > debug.keystore
41+
sudo cp -f debug.keystore /root/.android/.
42+
fi
43+
44+
- name: Install build dependencies
45+
run: |
46+
git submodule update --init --recursive
47+
48+
- name: Build artifact
49+
run: ./gradlew assemble
50+
51+
- name: Copy artifact
52+
run: |
53+
mkdir moonlight-android
54+
cp app/build/outputs/apk/root/debug/app-root-debug.apk "moonlight-android/app-root-debug-${COMMIT_PREFIX}.apk"
55+
cp app/build/outputs/apk/nonRoot/debug/app-nonRoot-debug.apk "moonlight-android/app-nonRoot-debug-${COMMIT_PREFIX}.apk"
56+
57+
- name: Upload artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: moonlight-android
61+
path: ${{ github.workspace }}/moonlight-android
62+
63+
release:
64+
name: Release
65+
runs-on: ubuntu-latest
66+
needs: [build]
67+
if: github.ref == 'refs/heads/master'
68+
69+
steps:
70+
- name: Checkout moonlight-android repo
71+
uses: actions/checkout@v4
72+
with:
73+
fetch-depth: 0
74+
75+
- name: Download Artifacts
76+
uses: actions/download-artifact@v4
77+
with:
78+
path: dist
79+
merge-multiple: true
80+
81+
- name: Re-zip artifacts
82+
run: |
83+
cd dist
84+
COMMIT_PREFIX=$(echo ${{ github.sha }} | cut -c1-8)
85+
for artifact in *.apk
86+
do
87+
file_name="${artifact%.apk}"
88+
echo "-> Creating ${file_name//-${COMMIT_PREFIX}/}.zip"
89+
zip "${file_name//-${COMMIT_PREFIX}/}.zip" "${file_name}.apk"
90+
done
91+
92+
- name: Update Git Tag
93+
run: |
94+
git tag -f Pre-release
95+
git push -f origin Pre-release
96+
97+
- name: Create Release
98+
uses: ncipollo/release-action@v1
99+
with:
100+
prerelease: true
101+
allowUpdates: true
102+
removeArtifacts: true
103+
replacesArtifacts: false
104+
tag: Pre-release
105+
artifacts: "dist/*.zip"

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ You can follow development on our [Discord server](https://moonlight-stream.org/
1818
* [F-Droid](https://f-droid.org/packages/com.limelight)
1919
* [APK](https://github.com/moonlight-stream/moonlight-android/releases)
2020

21+
## Nightly builds
22+
| Name | Status | File |
23+
|-------------------------|-----------------------------------|-----------------------------------------------------|
24+
| app nonRoot debug | [![Build Status][Build]][Actions] | [![moonlight-android][Download]][app nonRoot debug] |
25+
| app Root debug | [![Build Status][Build]][Actions] | [![moonlight-android][Download]][app root debug] |
26+
27+
[Actions]: https://github.com/moonlight-stream/moonlight-android/actions/workflows/build.yml
28+
[Build]: https://github.com/moonlight-stream/moonlight-android/actions/workflows/build.yml/badge.svg
29+
[Download]: https://img.shields.io/badge/Download-blue
30+
[app nonRoot debug]: https://github.com/moonlight-stream/moonlight-android/releases/download/Pre-release/app-nonRoot-debug.zip
31+
[app root debug]: https://github.com/moonlight-stream/moonlight-android/releases/download/Pre-release/app-root-debug.zip
32+
2133
## Building
2234
* Install Android Studio and the Android NDK
2335
* Run ‘git submodule update --init --recursive’ from within moonlight-android/
@@ -26,9 +38,9 @@ You can follow development on our [Discord server](https://moonlight-stream.org/
2638

2739
## Authors
2840

29-
* [Cameron Gutman](https://github.com/cgutman)
30-
* [Diego Waxemberg](https://github.com/dwaxemberg)
31-
* [Aaron Neyer](https://github.com/Aaronneyer)
41+
* [Cameron Gutman](https://github.com/cgutman)
42+
* [Diego Waxemberg](https://github.com/dwaxemberg)
43+
* [Aaron Neyer](https://github.com/Aaronneyer)
3244
* [Andrew Hennessy](https://github.com/yetanothername)
3345

3446
Moonlight is the work of students at [Case Western](http://case.edu) and was

0 commit comments

Comments
 (0)