Skip to content

[pre-commit.ci] pre-commit autoupdate #84

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #84

Workflow file for this run

name: Android CI
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "**"
paths-ignore:
- ".gitignore"
- "README.md"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/actions/**"
- ".github/workflows/iOS.yml"
- ".github/workflows/Linux.yml"
- ".github/workflows/macOS.yml"
- ".github/workflows/Windows.yml"
pull_request:
branches:
- main
paths-ignore:
- ".gitignore"
- "README.md"
# ignore CI for other platforms
- ".github/FUNDING.yml"
- ".github/actions/**"
- ".github/workflows/iOS.yml"
- ".github/workflows/Linux.yml"
- ".github/workflows/macOS.yml"
- ".github/workflows/Windows.yml"
concurrency:
# cancel jobs on PRs only
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
name: Build QMapLibre for Android (Qt${{ matrix.qt_version}}, ${{ matrix.abi }})
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- qt_version: 6.5.3
abi: x86
arch: android_x86
- qt_version: 6.5.3
abi: x86_64
arch: android_x86_64
- qt_version: 6.5.3
abi: armeabi-v7a
arch: android_armv7
- qt_version: 6.5.3
abi: arm64-v8a
arch: android_arm64_v8a
- qt_version: 6.6.2
abi: x86
arch: android_x86
- qt_version: 6.6.2
abi: x86_64
arch: android_x86_64
- qt_version: 6.6.2
abi: armeabi-v7a
arch: android_armv7
- qt_version: 6.6.2
abi: arm64-v8a
arch: android_arm64_v8a
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: source
submodules: recursive
fetch-depth: 0
- name: Download Qt (desktop)
id: qt-desktop
uses: jurplel/install-qt-action@v3
with:
aqtversion: ==3.1.*
version: ${{ matrix.qt_version }}
modules: qtlocation qtpositioning
set-env: false
extra: --base https://mirrors.ocf.berkeley.edu/qt/
- name: Download Qt (Android)
id: qt-android
uses: jurplel/install-qt-action@v3
with:
aqtversion: ==3.1.*
version: ${{ matrix.qt_version }}
target: android
arch: ${{ matrix.arch }}
modules: qtlocation qtpositioning
extra: --base https://mirrors.ocf.berkeley.edu/qt/
- name: Fix Qt release
if: ${{ matrix.abi }} == 'armeabi-v7a'
run: |
chmod +x "$Qt6_DIR/bin/qt-cmake"
sed -i "s/C:\/Qt\/Qt-${QT_VERSION}/\/usr\/local\/Qt-${QT_VERSION}/g" "$Qt6_DIR/lib/cmake/Qt6BuildInternals/QtBuildInternalsExtra.cmake"
- name: Set up OpenJDK 11
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: Android_QMapLibre_${{ matrix.qt_version }}_${{ matrix.abi }}
max-size: 200M
- name: Build QMapLibre
env:
ANDROID_ABI: ${{ matrix.abi }}
run: |
mkdir build && cd build
qt-cmake ../source/ \
-G Ninja \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_INSTALL_PREFIX="../install" \
-DQT_HOST_PATH="$(readlink -f "$Qt6_DIR/../gcc_64")"
ninja
ninja install
- name: Compress installation
run: |
pushd install
tar cjvf ../QMapLibre_Android.tar.bz2 *
popd
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: QMapLibre_Android_${{ matrix.qt_version }}_${{ matrix.abi }}
path: QMapLibre_Android.tar.bz2
combine:
name: Combine QMapLibre
runs-on: ubuntu-22.04
needs: build
strategy:
matrix:
qt_version: [6.5.3, 6.6.2]
steps:
- name: Download artifacts for x86
uses: actions/download-artifact@v4
with:
name: QMapLibre_Android_${{ matrix.qt_version}}_x86
path: x86
- name: Download artifacts for x86_64
uses: actions/download-artifact@v4
with:
name: QMapLibre_Android_${{ matrix.qt_version}}_x86_64
path: x86_64
- name: Download artifacts for armeabi-v7a
uses: actions/download-artifact@v4
with:
name: QMapLibre_Android_${{ matrix.qt_version}}_armeabi-v7a
path: armeabi-v7a
- name: Download artifacts for arm64-v8a
uses: actions/download-artifact@v4
with:
name: QMapLibre_Android_${{ matrix.qt_version}}_arm64-v8a
path: arm64-v8a
- name: Combine artifacts
run: |
mkdir install && pushd install
tar xf ../x86/QMapLibre_Android.tar.bz2
tar xf ../x86_64/QMapLibre_Android.tar.bz2
tar xf ../armeabi-v7a/QMapLibre_Android.tar.bz2
tar xf ../arm64-v8a/QMapLibre_Android.tar.bz2
popd
- name: Create artifacts
run: |
pushd install
tar cjvf ../QMapLibre_Android.tar.bz2 *
popd
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: QMapLibre_Android_${{ matrix.qt_version}}
path: QMapLibre_Android.tar.bz2
release:
name: Release QMapLibre
if: github.ref_type == 'tag'
runs-on: ubuntu-22.04
needs: combine
permissions:
contents: write
strategy:
matrix:
qt_version: [6.5.3, 6.6.2]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: QMapLibre_Android_${{ matrix.qt_version }}
- name: Make tarball
env:
TAG_NAME: ${{ github.ref_name }}
QT_VERSION: ${{ matrix.qt_version }}
run: |
mv QMapLibre_Android.tar.bz2 QMapLibre_${TAG_NAME}_Qt${QT_VERSION}_Android.tar.bz2
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: QMapLibre_${{ github.ref_name }}_Qt${{ matrix.qt_version }}_Android.tar.bz2
allowUpdates: true
draft: true