forked from MapComplete/MapComplete
54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
on:
|
|
push:
|
|
|
|
jobs:
|
|
build_android:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: https://source.mapcomplete.org/actions/checkout@v4
|
|
- uses: https://source.mapcomplete.org/actions/setup-android@v3.2.2
|
|
|
|
- name: Set up Node.js
|
|
uses: https://source.mapcomplete.org/actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
cache-dependency-path: package-lock.json
|
|
|
|
- name: install deps
|
|
run: npm ci
|
|
shell: bash
|
|
|
|
- run: mkdir -p ./assets/generated && npm run init
|
|
|
|
- name: clone submodule
|
|
shell: bash
|
|
run: |
|
|
echo -e "[submodule \"android\"]\n\tpath = android\n\turl = https://source.mapcomplete.org/MapComplete/android-wrapper.git" > .gitmodules
|
|
cat .gitmodules
|
|
git submodule init
|
|
git submodule update
|
|
|
|
- name: Decode keystore
|
|
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > ~/.gradle/release-key.jks
|
|
|
|
- name: Grant execute permission to gradlew
|
|
run: cd android && chmod +x ./gradlew
|
|
|
|
- name: Build signed APK
|
|
run: |
|
|
cd android
|
|
export ANDROID_SDK_HOME=/home/runner/.android/sdk/
|
|
export PATH=$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/:$ANDROID_SDK_HOME/cmdline-tools/latest/tools/bin:$PATH
|
|
export storeFile=my-release-key.jks
|
|
export storePassword=${{ secrets.KEYSTORE_PASSWORD }}
|
|
export keyAlias=${{ secrets.KEY_ALIAS }}
|
|
export keyPassword=${{ secrets.KEY_PASSWORD }}
|
|
./gradlew assembleRelease
|
|
|
|
- name: Upload APK to hetzner
|
|
shell: bash
|
|
run: |
|
|
TAG=$( echo ${{ env.GITHUB_REF_NAME }} )
|
|
scp android/app/build/outputs/apk/release/app-release.apk hetzner:~/apk/mapcomplete-$TAG.apk
|