-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.37 KB
/
gradle-publish.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
name: Build APK and Notify Discord
on:
push:
branches:
- main
jobs:
build-and-notify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Android SDK
uses: actions/setup-java@v3
with:
java-version: '11'
- name: Grant execute permissions to gradlew
run: chmod +x gradlew
- name: Build APK
run: ./gradlew assembleRelease
- name: Get latest commit message and ID
id: get_commit_info
run: |
echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> $GITHUB_ENV
echo "COMMIT_ID=${GITHUB_SHA}" >> $GITHUB_ENV
- name: Send Discord notification
uses: dawidd6/action-discord@v2
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
username: "Pre-Build Builder"
avatar_url: "https://media.discordapp.net/attachments/1066717089118814258/1183076684770054248/Xt6r8d0v.png?ex=65870506&is=65749006&hm=ce4090a900734cc623540a0a63a0f01844c9d54a0b33683fccb8587d408ca73b&"
content: |
**New APK build available!**
* **Commit ID:** ${{ steps.get_commit_info.outputs.COMMIT_ID }}
* **Commit message:** ${{ steps.get_commit_info.outputs.COMMIT_MESSAGE }}
* **Download:** https://github.com/${{ github.repository }}/releases/latest/download/app-release.apk