Skip to content

Commit 257b4fc

Browse files
committed
Added github action to build release apk
1 parent 1a85b74 commit 257b4fc

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/android.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build Release APK
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set Up JDK
16+
uses: actions/setup-java@v3
17+
with:
18+
distribution: zulu
19+
java-version: 18
20+
21+
- name: Cache Gradle and wrapper
22+
uses: actions/cache@v2
23+
with:
24+
path: |
25+
~/.gradle/caches
26+
~/.gradle/wrapper
27+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
28+
restore-keys: |
29+
${{ runner.os }}-gradle-
30+
31+
- name: Grant execute permission for gradlew
32+
run: chmod +x ./gradlew
33+
34+
- name: Build Release APK
35+
run: ./gradlew assembleRelease
36+
37+
- name: Generate build number
38+
id: buildnumber
39+
uses: einaregilsson/build-number@v3
40+
with:
41+
token: ${{secrets.TOKEN}}
42+
43+
- name: Push to Releases
44+
uses: ncipollo/release-action@v1
45+
with:
46+
artifacts: "app/build/outputs/apk/release/*"
47+
tag: build-${{ steps.buildnumber.outputs.build_number }}
48+
token: ${{ secrets.TOKEN }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
.DS_Store
1313
/build
1414
/captures
15-
/.github
1615
/firebase/*.json
1716
/firebase/config.py
1817
/firebase/assets/*

0 commit comments

Comments
 (0)