-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 2.07 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
name: Android CI
on:
push:
branches: [ "master" ]
paths:
- '**'
- '!update.json'
- '!.github/workflows/*.yml'
- '!*.md'
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Write key to gradle.properties
run: |
echo ${{ secrets.KEY_STORE }} | base64 --decode > app/key.jks
printf "\nRELEASE_FILE=key.jks" >> gradle.properties
printf "\nRELEASE_PASSWORD=${{ secrets.PASSWORD }}" >> gradle.properties
printf "\nRELEASE_ALIAS=${{ secrets.ALIAS }}" >> gradle.properties
- name: Build and test app
run: |
./gradlew assembleRelease
- name: Setup NodeJs
uses: actions/[email protected]
with:
node-version: 22
- name: Write Bot Files and Configure environment variables
run: |
APKVERSION=$(grep -Po 'versionName\s*=\s*"\K[^"]+' app/build.gradle.kts)
APKNEWPATH="app/build/outputs/apk/release/WaRevamp_$APKVERSION.apk"
cp app/build/outputs/apk/release/app-release.apk $APKNEWPATH
echo ${{ secrets.BOT_INDEX }} | base64 --decode > index.js
echo ${{ secrets.BOT_PACKAGE }} | base64 --decode > package.json
echo "CHANGE_LOG_PATH=change_log.txt" >> $GITHUB_ENV
echo "CHAT_ID=${{ secrets.CHAT_ID }}" >> $GITHUB_ENV
echo "FILE_PATH=$APKNEWPATH" >> $GITHUB_ENV
echo "BOT_TOKEN=${{ secrets.BOT_TOKEN }}" >> $GITHUB_ENV
- name: Install Dependencies
run: npm install
- name: Run Node.js script
run: node index.js
- name: Upload artifacts
uses: actions/upload-artifact@v4
id: upload
with:
name: app-release
path: app/build/outputs/apk/release/app-release.apk