Repository navigation
62 lines (51 loc) · 1.8 KB
/
Copy pathbuild.yml
File metadata and controls
62 lines (51 loc) · 1.8 KB
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
56
57
58
59
60
61
62
name: Build APK
# Every branch gets a build (download it from the run's artifacts); only
# main publishes to the "latest" release.
on:
push:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v4
with:
gradle-version: "8.11.1"
- name: Signing key
env:
KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }}
run: |
if [ -n "$KEYSTORE_B64" ]; then echo "$KEYSTORE_B64" | base64 -d > app/release.p12; fi
- name: Build
# no API keys here: the published APK must not contain any
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
run: gradle :app:assembleRelease --no-daemon --stacktrace
- name: Fleet survey
# which buses are on the road, and any the fleet table doesn't know yet
continue-on-error: true
env:
AT_API_KEY: ${{ secrets.AT_API_KEY }}
run: python3 tools/fleet_survey.py
- name: Name the APK
run: cp app/build/outputs/apk/release/app-release.apk AKL-Live.apk
- uses: actions/upload-artifact@v4
with:
name: AKL-Live
path: AKL-Live.apk
- name: Publish to the "latest" release
if: github.ref == 'refs/heads/main'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release delete latest --yes --cleanup-tag || true
gh release create latest AKL-Live.apk \
--title "AKL Live (build ${{ github.run_number }})" \
--notes "Built from ${{ github.sha }}. Download AKL-Live.apk on your phone and open it to install or update."