Skip to content

Commit 981c345

Browse files
committed
Add github action to build APK
1 parent a4c1822 commit 981c345

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/android.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Android Build APK
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: set up JDK 11
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '11'
21+
distribution: 'temurin'
22+
- name: Grant execute permission for gradlew
23+
run: chmod +x gradlew
24+
- name: Build with Gradle
25+
uses: gradle/gradle-build-action@v2
26+
with:
27+
arguments: assembleDebug
28+
dependency-graph: generate-and-submit
29+
artifact-retention-days: 7
30+
- name: Push release
31+
run: |
32+
git init
33+
git config user.name "github-actions"
34+
git config user.email "41898282+github-actions@users.noreply.github.com"
35+
git remote add origin "https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}"
36+
git checkout -b apk
37+
git add *.apk
38+
git commit -m "Build debug APK for $GITHUB_SHA"
39+
git push -f -u origin apk
40+
working-directory: app/build/outputs/apk/debug

0 commit comments

Comments
 (0)