Skip to content

Commit f4fa001

Browse files
committed
new Android build workflow
1 parent c1af5e2 commit f4fa001

3 files changed

Lines changed: 44 additions & 63 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Android Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
android:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with: { node-version: 22 }
19+
20+
- uses: pnpm/action-setup@v3
21+
with: { version: 9 }
22+
23+
- run: |
24+
cd frontend
25+
pnpm install
26+
pnpm run build
27+
npx cap sync android
28+
29+
- uses: actions/setup-java@v4
30+
with:
31+
distribution: temurin
32+
java-version: 17
33+
34+
- run: |
35+
cd frontend/android
36+
./gradlew assembleDebug
37+
38+
- name: Upload APK to Release
39+
uses: softprops/action-gh-release@v2
40+
with:
41+
files: frontend/android/app/build/outputs/apk/debug/app-debug.apk

‎.github/workflows/deploy_frontend_to_pages.yml‎

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -57,64 +57,4 @@ jobs:
5757
id: deployment
5858
uses: actions/deploy-pages@v4
5959

60-
build-android:
61-
runs-on: ubuntu-latest
62-
needs: deploy # wait for pages deploy (optional but clean)
63-
64-
permissions:
65-
contents: write
66-
67-
steps:
68-
- uses: actions/checkout@v4
69-
70-
- name: Setup Node
71-
uses: actions/setup-node@v4
72-
with:
73-
node-version: 22
74-
75-
- name: Setup pnpm
76-
uses: pnpm/action-setup@v3
77-
with:
78-
version: 9
79-
80-
- name: Install frontend deps
81-
working-directory: frontend
82-
run: pnpm install
83-
84-
- name: Build web app
85-
working-directory: frontend
86-
run: pnpm run build
87-
88-
- name: Sync Capacitor
89-
working-directory: frontend
90-
run: npx cap sync android
91-
92-
- name: Setup Java
93-
uses: actions/setup-java@v4
94-
with:
95-
distribution: temurin
96-
java-version: 17
97-
98-
- name: Build Debug APK
99-
working-directory: frontend/android
100-
run: ./gradlew assembleDebug
101-
102-
- name: Upload APK artifact
103-
uses: actions/upload-artifact@v4
104-
with:
105-
name: Notes-Android-APK
106-
path: frontend/android/app/build/outputs/apk/debug/app-debug.apk
107-
108-
- name: Update README with APK link
109-
run: |
110-
APK_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
111-
sed -i "/## 📱 Android App/,+2c\\## 📱 Android App\n\n⬇️ **Latest APK:** \n$APK_URL" README.md
112-
113-
- name: Commit README update
114-
run: |
115-
git config user.name "github-actions"
116-
git config user.email "github-actions@github.com"
117-
git add README.md
118-
git commit -m "chore: update Android APK link" || echo "No changes"
119-
git push
120-
60+

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ Notes turns your ideas, quotes, and short writings into a personal library you e
5050
---
5151
## 📱 Android App
5252

53-
⬇️ **Latest APK:**
54-
(Updated automatically)
53+
⬇️ Download APK
54+
https://github.com/PriDebnath/Notes/releases/latest/download/app-debug.apk
5555

0 commit comments

Comments
 (0)