-
Notifications
You must be signed in to change notification settings - Fork 170
75 lines (66 loc) · 2.34 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Android CI
env:
# The name of the main module repository
main_project_module: app
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
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: 'corretto'
cache: gradle
- uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.5
- name: Create base64 jks file
run: echo "${{ secrets.BASE_64_SIGNING_KEY }}" > app/release_keystore.txt
- name: Create jks file
run: base64 -d "app/release_keystore.txt" > app/release_keystore.jks
- name: Create Blank Local Properties FIle
run: touch local.properties
- name: Create Keystore Properties File
run: echo "${{ secrets.LOCAL_PROPERTIES }}" > keystore.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
# Create APK Debug
- name: Build apk debug project (APK)
run: ./gradlew assembleDebug
# Create APK Release
- name: Build apk release project (APK)
run: ./gradlew assemble
# Upload Artifact Build
# Noted For Output [main_project_module]/build/outputs/apk/debug/
- name: Upload APK Debug
uses: actions/upload-artifact@v3
with:
name: YTDLnis APK debug generated
path: ${{ env.main_project_module }}/build/outputs/apk/debug/
# Noted For Output [main_project_module]/build/outputs/apk/release/
- name: Upload APK Release
uses: actions/upload-artifact@v3
with:
name: YTDLnis APK release generated
path: ${{ env.main_project_module }}/build/outputs/apk/release/
- name: send telegram message on push or pull
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}