Skip to content

Commit 934a01b

Browse files
committed
add nightly-build action
1 parent b125a9b commit 934a01b

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Nightly Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
evaluateChanges:
11+
name: Evaluate changes for run or skipping nightly build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 1
17+
18+
- name: Check
19+
run: |
20+
commits=`git rev-list --after="24 hours" master`
21+
shouldBuild="$commits" == ""
22+
echo shouldBuild
23+
echo $shouldBuild
24+
echo ::set-output name=SHOULD_BUILD::shouldBuild
25+
26+
nightlyBuild:
27+
name: Generate Nightly Build
28+
runs-on: ubuntu-latest
29+
needs: evaluateChanges
30+
steps:
31+
- name: check
32+
run: |
33+
echo ${needs.evaluateChanges.outputs}
34+
echo ${needs.evaluateChanges.outputs.SHOULD_BUILD}
35+
echo ${needs.evaluateChanges.outputs.SHOULD_BUILD} == 'true'
36+
37+
- uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 1
40+
41+
- name: set up JDK
42+
uses: actions/setup-java@v2
43+
with:
44+
java-version: '11'
45+
distribution: 'adopt'
46+
cache: gradle
47+
48+
- name: Decode google-services.json
49+
run: echo ${{ secrets.FIREBASE_SECRET }} > ${{ github.workspace }}/app/google-services.json
50+
51+
- name: Build Apk
52+
run: ./gradlew assembleProductionDebug --stacktrace
53+
54+
- name: Finding Apk
55+
id: apk_finder
56+
run: echo ::set-output name=APK_PATH::`find . -type f -iname *.apk`
57+
58+
# - name: Send Apk in Telegram
59+
# uses: appleboy/[email protected]
60+
# with:
61+
# to: ${{ secrets.TELEGRAM_TO }}
62+
# token: ${{ secrets.TELEGRAM_TOKEN }}
63+
# document: ${{ steps.apk_finder.outputs.APK_PATH }}

0 commit comments

Comments
 (0)