Skip to content

Commit 3c587e2

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

2 files changed

Lines changed: 117 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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+
submodules: recursive
31+
32+
- name: Decode debug keystore
33+
env:
34+
DEBUG_KEYSTORE: ${{ secrets.DEBUG_KEYSTORE }}
35+
run: |
36+
if [ -z "$DEBUG_KEYSTORE" ]
37+
then
38+
echo "No debug keystore value"
39+
else
40+
echo $DEBUG_KEYSTORE > debug.keystore.base64
41+
base64 --decode debug.keystore.base64 > debug.keystore
42+
sudo cp -f debug.keystore /root/.android/.
43+
fi
44+
45+
- name: Build artifact
46+
run: ./gradlew assemble
47+
48+
- name: Copy artifact
49+
run: |
50+
mkdir moonlight-android
51+
cp app/build/outputs/apk/root/debug/app-root-debug.apk "moonlight-android/app-root-debug-${COMMIT_PREFIX}.apk"
52+
cp app/build/outputs/apk/nonRoot/debug/app-nonRoot-debug.apk "moonlight-android/app-nonRoot-debug-${COMMIT_PREFIX}.apk"
53+
54+
- name: Upload artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: moonlight-android
58+
path: ${{ github.workspace }}/moonlight-android
59+
60+
release:
61+
name: Release
62+
runs-on: ubuntu-latest
63+
needs: [build]
64+
if: github.ref == 'refs/heads/master'
65+
66+
steps:
67+
- name: Checkout moonlight-android repo
68+
uses: actions/checkout@v4
69+
with:
70+
fetch-depth: 0
71+
72+
- name: Download Artifacts
73+
uses: actions/download-artifact@v4
74+
with:
75+
path: dist
76+
merge-multiple: true
77+
78+
- name: Re-zip artifacts
79+
run: |
80+
cd dist
81+
COMMIT_PREFIX=$(echo ${{ github.sha }} | cut -c1-8)
82+
for artifact in *.apk
83+
do
84+
file_name="${artifact%.apk}"
85+
echo "-> Creating ${file_name//-${COMMIT_PREFIX}/}.zip"
86+
zip "${file_name//-${COMMIT_PREFIX}/}.zip" "${file_name}.apk"
87+
done
88+
89+
- name: Update Git Tag
90+
run: |
91+
git tag -f Pre-release
92+
git push -f origin Pre-release
93+
94+
- name: Create Release
95+
uses: ncipollo/release-action@v1
96+
with:
97+
prerelease: true
98+
allowUpdates: true
99+
removeArtifacts: true
100+
replacesArtifacts: false
101+
tag: Pre-release
102+
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)