Skip to content

Commit 6a5528b

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

File tree

2 files changed

+130
-3
lines changed

2 files changed

+130
-3
lines changed

.github/workflows/build.yml

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