Skip to content

Add APK signing

Add APK signing #40

Workflow file for this run

name: Android
on: [ push, pull_request ]
env:
BUILD_TYPE: Release
QT_VERSION: "6.6.2"
QT_ARCH: "android_arm64_v8a"
QT_HOST_ARCH: "gcc_64"
QT_TARGET: "android"
# https://doc.qt.io/qt-6/android-getting-started.html
PLATFORM_VERSION: "33"
BUILD_TOOLS_VERSION: "33.0.0"
NDK_VERSION: "25.1.8937393"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: 'cmdline-tools;latest platform-tools platforms;android-${{env.PLATFORM_VERSION}} build-tools;${{env.BUILD_TOOLS_VERSION}} ndk;${{env.NDK_VERSION}}'
- name: Install Qt (Android)
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{env.QT_VERSION}}
arch: ${{env.QT_ARCH}}
target: ${{env.QT_TARGET}}
- name: Install Qt (Linux)
uses: jurplel/install-qt-action@v3
with:
cache: true
version: ${{env.QT_VERSION}}
arch: ${{env.QT_HOST_ARCH}}
- name: Configure CMake
env:
QT_HOST_PATH: ${{runner.workspace}}/Qt/${{env.QT_VERSION}}/${{env.QT_HOST_ARCH}}
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/${{env.NDK_VERSION}}
run: ${{runner.workspace}}/Qt/$QT_VERSION/$QT_ARCH/bin/qt-cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
run: cmake --build .
- name: Sign APK
env:
KEYSTORE: ${{secrets.KEYSTORE_FILE}}
ALIAS: ${{secrets.KEYSTORE_ALIAS}}
PASSWORD: ${{secrets.KEYSTORE_PASSWORD}}
run: |
echo -n "$KEYSTORE" | base64 -d > "release.keystore"
apksigner sign --ks "release.keystore" --ks-key-alias "$ALIAS" --ks-pass "pass:$PASSWORD" "spotify-qt-quick/android-build/build/outputs/apk/release/android-build-release-unsigned.apk"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: spotify-qt-quick
path: ${{runner.workspace}}/spotify-qt-quick/android-build/build/outputs/apk/release/*.apk