forked from zacharee/WiFiList
-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.75 KB
/
build.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
44
45
46
47
48
49
50
51
52
53
54
55
name: Android CI
on:
workflow_dispatch:
push:
branches: [ master, main ]
paths-ignore: [ '*.md' ]
pull_request:
branches: [ master, main ]
paths-ignore: [ '*.md' ]
jobs:
validation:
name: Gradle Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
build:
name: Build (debug)
runs-on: ubuntu-latest
needs: validation
if: ${{ needs.validation.result == 'success' && (contains(fromJSON('["workflow_dispatch", "pull_request"]'), github.event_name) || !startsWith(github.event.head_commit.message, '[skip ci]')) }}
steps:
- uses: actions/checkout@v4
- run: |
APP_VERSION="v$(gradle -q printVersionName)" || APP_VERSION="v$(cat ./app/build.gradle.kts ./app/build.gradle | grep -m1 versionName | awk -F'"' '{ print $2; }')"
echo APP_VERSION="$APP_VERSION" >> "$GITHUB_ENV"
echo APP_NAME="${{ github.event.repository.name }}_${APP_VERSION}" >> "$GITHUB_ENV"
shell: bash
- uses: errr-maxx-builds/android-setup-build-env@master
with:
usePatchedSDK: true # custom
- run: ./gradlew assembleDebug
- run: mv ./app/build/outputs/apk/debug/app-debug.apk "./${{ env.APP_NAME }}.apk"
- uses: errr-maxx-builds/android-sign-apk@master
with:
in: ./${{ env.APP_NAME }}.apk
out: ./${{ env.APP_NAME }}.apk
ks: ${{ secrets.SIGNING_KEYSTORE }}
ksPass: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
key: ${{ secrets.SIGNING_ALIAS }}
keyPass: ${{ secrets.SIGNING_ALIAS_PASSWORD }}
- uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}
path: ./${{ env.APP_NAME }}.apk