-
Notifications
You must be signed in to change notification settings - Fork 44
executable file
·136 lines (118 loc) · 4.23 KB
/
Copy pathandroid.yml
File metadata and controls
executable file
·136 lines (118 loc) · 4.23 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Android CI
on:
workflow_dispatch:
inputs:
UPAPK:
description: 'Release APK'
type: boolean
default: false
UPTG:
description: 'Send Telegram'
type: boolean
default: false
push:
paths:
- 'app/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: write-all
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
CHAT_ID: ${{ secrets.CHAT_ID }}
TG_TOKEN: ${{ secrets.TG_TOKEN }}
UPAPK: ${{ inputs.UPAPK }}
UPTG: ${{ inputs.UPTG }}
jobs:
build-release:
if: ${{ github.repository_owner == 'Zenlua' }}
runs-on: ubuntu-latest
environment: Stable
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-cache-release
- name: Build APK
run: |
chmod +x ./gradlew
[ "$UPAPK" == "true" ] || echo 1 > app/src/main/assets/beta
./gradlew assembleRelease -x lint -x test
VER=$(grep -m1 'versionName ' app/build.gradle | cut -d'"' -f2)
echo "Tool-Tree $VER"
echo "VER=$VER" >> $GITHUB_ENV
mkdir -p Up Beta
[ "$UPAPK" == "true" ] && cp -rf app/build/outputs/apk/*/*.apk "Up/Tool-Tree.$VER.apk"
[ "$UPAPK" == "true" ] || cp -rf app/build/outputs/apk/*/*.apk "Beta/Tool-Tree-beta.apk"
ls Up
echo -e "- \n- See version notes: [Changelog](https://zenlua.github.io/Tool-Tree/Version.html)" > change.txt
if [ "$UPTG" == "true" ]; then
echo "Telegram"
chat_tg="🎉 <b>Update new version Tool-Tree</b>
• Application has many tools, ROM and APK editing, Many add-on utilities
• 🎋 <b>Version:</b> $VER
• 🪴 <b>Author:</b> Kakathic
• 📱 <b>Device:</b> Arm64
• 🧾 <b>Notes:</b> <a href=\"https://github.com/Zenlua/Tool-Tree/blob/main/Version.md\">Changelog</a>
• 📚 <b>Instruct:</b> Root | <a href=\"https://zenlua.github.io/Tool-Tree/website/Guide.html\">No-Root</a>
• 📥 <b><a href=\"https://github.com/Zenlua/Tool-Tree/releases/tag/V$VER\">Download</a></b>
🌐 <b>Language:</b> Help <a href=\"https://github.com/Zenlua/Tool-Tree#-language\">translation</a>
#release@tool_tree"
curl -s -X POST "https://api.telegram.org/bot$TG_TOKEN/sendMessage" \
-d chat_id="$CHAT_ID" \
-d parse_mode="HTML" \
--data-urlencode text="$chat_tg"
fi
- name: Beta APK
uses: softprops/action-gh-release@v2
with:
name: "Tool-Tree ${{ env.VER }} beta"
tag_name: "beta"
files: Beta/*
prerelease: true
- name: Release APK
if: ${{ github.event_name == 'workflow_dispatch' && inputs.UPAPK == true }}
uses: softprops/action-gh-release@v2
with:
name: "Tool-Tree ${{ env.VER }}"
tag_name: "V${{ env.VER }}"
files: Up/*
prerelease: false
body_path: "change.txt"
build-debug:
runs-on: ubuntu-latest
environment: Debug
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-cache-debug
- name: Build APK
run: |
chmod +x ./gradlew ./.github/modun.sh
./.github/modun.sh
./gradlew assembleDebug -x lint -x test
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: debug-apk
path: app/build/outputs/apk/*/*.apk