Skip to content

Rework for Android builds/workflows #1248

Rework for Android builds/workflows

Rework for Android builds/workflows #1248

Workflow file for this run

# SuperTux
# Copyright (C) 2021-2021 Sergii Pylypenko <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
name: Android
on:
workflow_dispatch:
inputs: {}
push:
branches:
- master
tags:
- '*'
pull_request: {}
jobs:
build-android:
strategy:
fail-fast: false
matrix:
arch: [arm64-v8a, armeabi-v7a, x86, x86_64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set script permissions
run: chmod +x ./.ci_scripts/*.sh
- name: Prepare SDL Android project
run: |
./.ci_scripts/clone_dependency.sh libsdl-org/SDL release-2.26.5
mv ./SDL/android-project/ ./build.android
mv ./SDL/ ./build.android/app/jni/SDL
- name: Clone dependencies
working-directory: build.android/app/jni
run: |
../../../.ci_scripts/clone_dependency.sh libsdl-org/SDL_image release-2.6.3
../../../.ci_scripts/clone_dependency.sh libsdl-org/SDL_ttf release-2.20.2
../../../.ci_scripts/clone_dependency.sh curl/curl curl-8_0_1
../../../.ci_scripts/clone_dependency.sh glennrp/libpng v1.6.39
../../../.ci_scripts/clone_dependency.sh fmtlib/fmt 9.1.0
../../../.ci_scripts/clone_dependency.sh g-truc/glm 0.9.9.8
../../../.ci_scripts/clone_dependency.sh xiph/vorbis v1.3.7
../../../.ci_scripts/clone_dependency.sh xiph/ogg v1.3.5
../../../.ci_scripts/clone_dependency.sh kcat/openal-soft 1.23.1
../../../.ci_scripts/clone_dependency.sh janbar/openssl-cmake master
../../../.ci_scripts/clone_dependency.sh SuperTux/physfs master
../../../.ci_scripts/clone_dependency.sh driedfruit/SDL_SavePNG master
../../../.ci_scripts/clone_dependency.sh SuperTux/sexp-cpp master
../../../.ci_scripts/clone_dependency.sh albertodemichelis/squirrel v3.2
../../../.ci_scripts/clone_dependency.sh SuperTux/tinygettext master
ln -s ../../../ supertux
- name: Copy SuperTux Android project files
run: cp -r -f ./mk/android/* ./build.android/
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 20
cache: 'gradle'
- name: Setup Android enviroment
uses: android-actions/setup-android@v2
with:
packages: |
platforms;android-33
ndk;25.2.9519653
build-tools;33.0.2
- name: Build APK
working-directory: build.android
run: |
chmod +x ./gradlew
./gradlew assembleRelease --cpuarch="${{ matrix.arch }}" --info
- name: Upload unsigned APK
uses: actions/upload-artifact@v3
with:
name: "Unsigned APK"
path: "build.android/app/build/outputs/apk/release/app-release-unsigned.apk"
- name: Sign APK
working-directory: build.android/app/build/outputs/apk/release
run: |
# removing possible confusion
cp ./app-release-unsigned.apk ./app-release.apk
keytool -genkey -v \
-keystore supertux.keystore -alias supertux \
-storepass supertux \
-dname "cn=MatusGuy, ou=Contributor, O=SuperTux Team, L=Antarctica, ST=Antarctica, C=aq" \
-keyalg RSA -keysize 2048 -validity 10000
$ANDROID_SDK_ROOT/build-tools/33.0.2/apksigner sign \
--ks supertux.keystore --ks-pass pass:supertux \
./app-release.apk
- name: Upload signed APK
uses: actions/upload-artifact@v3
with:
name: "Signed APK"
path: "build.android/app/build/outputs/apk/release/app-release.apk"