Skip to content

Commit e2f5f87

Browse files
committed
Refactor build workflow to include Telegram notification on push
1 parent 46a4bf7 commit e2f5f87

File tree

1 file changed

+55
-67
lines changed

1 file changed

+55
-67
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,69 @@
11
on:
2-
push:
3-
branches:
4-
- main
5-
jobs:
6-
build:
7-
runs-on: ubuntu-latest
2+
push:
3+
branches:
4+
- main
85

9-
steps:
10-
- uses: actions/checkout@v4
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
119

12-
- name: set up JDK 19
13-
uses: actions/setup-java@v4
14-
with:
15-
java-version: '19'
16-
distribution: 'temurin'
17-
cache: gradle
10+
steps:
11+
- uses: actions/checkout@v4
1812

19-
- uses: oven-sh/setup-bun@v2
13+
- name: set up JDK 19
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: '19'
17+
distribution: 'temurin'
18+
cache: gradle
2019

21-
- name: Restore Gradle cache
22-
uses: actions/cache@v3
23-
with:
24-
path: |
25-
~/.gradle/caches
26-
~/.gradle/wrapper
27-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
28-
restore-keys: |
29-
${{ runner.os }}-gradle-
20+
- uses: oven-sh/setup-bun@v2
3021

31-
- name: Restore Android build outputs cache
32-
uses: actions/cache@v3
33-
with:
34-
path: |
35-
android/.gradle
36-
android/app/build
37-
key: ${{ runner.os }}-android-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
38-
restore-keys: |
39-
${{ runner.os }}-android-build-
22+
- name: Restore Gradle cache
23+
uses: actions/cache@v3
24+
with:
25+
path: |
26+
~/.gradle/caches
27+
~/.gradle/wrapper
28+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
29+
restore-keys: |
30+
${{ runner.os }}-gradle-
4031
41-
- name: Install npm dependencies with bun
42-
run: bun install
32+
- name: Restore Android build outputs cache
33+
uses: actions/cache@v3
34+
with:
35+
path: |
36+
android/.gradle
37+
android/app/build
38+
key: ${{ runner.os }}-android-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
39+
restore-keys: |
40+
${{ runner.os }}-android-build-
4341
44-
- name: Grant execute permission for gradlew
45-
run: cd android && chmod +x gradlew
42+
- name: Install npm dependencies with bun
43+
run: bun install
4644

47-
- name: Build Android Release
48-
run: cd android && ./gradlew assembleRelease
45+
- name: Grant execute permission for gradlew
46+
run: cd android && chmod +x gradlew
4947

50-
- name: Upload Artifact
51-
uses: actions/upload-artifact@v4
52-
with:
53-
name: tech-triangle
54-
path: android/app/build/outputs/apk/release/Tech_Triangle-arm64-v8a.apk
48+
- name: Build Android Release
49+
run: cd android && ./gradlew assembleRelease
5550

56-
notify:
57-
runs-on: ubuntu-latest
58-
needs: build
51+
- name: send telegram message on push
52+
uses: appleboy/telegram-action@master
53+
with:
54+
to: ${{ secrets.TELEGRAM_TO }}
55+
token: ${{ secrets.TELEGRAM_TOKEN }}
56+
message_file: android/app/build/outputs/apk/release/Tech_Triangle-arm64-v8a.apk
57+
message: |
58+
${{ github.actor }} created commit:
59+
Commit message: ${{ github.event.commits[0].message }}
5960
60-
steps:
61-
- uses: actions/checkout@v4
61+
Repository: ${{ github.repository }}
6262
63-
- name: Download Artifact
64-
uses: actions/download-artifact@v4
65-
with:
66-
name: tech-triangle
67-
path: android/app/build/outputs/apk/release
63+
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
6864
69-
- name: send telegram message on push
70-
uses: appleboy/telegram-action@master
71-
with:
72-
to: ${{ secrets.TELEGRAM_TO }}
73-
token: ${{ secrets.TELEGRAM_TOKEN }}
74-
message_file: android/app/build/outputs/apk/release/Tech_Triangle-arm64-v8a.apk
75-
message: |
76-
${{ github.actor }} created commit:
77-
Commit message: ${{ github.event.commits[0].message }}
78-
79-
Repository: ${{ github.repository }}
80-
81-
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
65+
- name: Upload Artifact
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: tech-triangle
69+
path: android/app/build/outputs/apk/release/Tech_Triangle-arm64-v8a.apk

0 commit comments

Comments
 (0)