Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
7.5 KB
Raw Blame
.android-base:
  stage: build
  image: $VM_IMAGE_NAME_ANDROID
  tags:
    - VM
    - amd64
  extends:
    - .ci-manual-job-mixin
    - .ci-artifacts-with-packages-mixin
  variables:
    KDECI_BUILD_TYPE: Release
    KDECI_GITLAB_SERVER: https://invent.kde.org/
    KDECI_REPO_METADATA_PATH: $CI_PROJECT_DIR/krita-deps-management/repo-metadata
    KDECI_COMPRESS_PACKAGES_ON_DOWNLOAD: False
    KDECI_SKIP_ECM_ANDROID_TOOLCHAIN: True
    # ANDROID_HOME: /opt/android-tooling # <-- set up in the base image!
    # KDECI_ANDROID_SDK_ROOT: $ANDROID_HOME/sdk # <-- set up in the base image!
    # KDECI_ANDROID_NDK_ROOT: $ANDROID_HOME/android-ndk-r22b/ # <-- set up in the base image!
    CMAKE_TOOLCHAIN_FILE: $CI_PROJECT_DIR/krita-deps-management/tools/android-toolchain-krita.cmake
    KDECI_EXTRA_CMAKE_ARGS: >
      -DHIDE_SAFE_ASSERTS=OFF
      -DBUILD_TESTING=ON
    KRITACI_ANDROID_PACKAGE_TYPE: debug
    KRITACI_SKIP_UPLOAD_NIGHTLY_PACKAGE: True
    KRITACI_PUBLISH_BUILD_CONFIG: upstream-ci-utilities/signing/publishbuild.ini

    # androiddeployqt doesn't support having _install folder with QML deps
    # in the same directory as the source root itself. It will just skip
    # all the Qt's QML modules in this case. So switch working directory to
    # another one outside the source tree
    KDECI_WORKDIR_PATH: /tmp/wd
  interruptible: true
  before_script:
    - . /var/lib/ci-files/setup-environment.sh

    - git clone https://invent.kde.org/packaging/krita-deps-management.git -b $DEPS_REPO_BRANCH_NAME_ANDROID --depth=1
    - git clone https://invent.kde.org/packaging/krita-ci-utilities.git krita-deps-management/ci-utilities --depth=1
    - git clone https://invent.kde.org/sysadmin/ci-notary-service.git --depth=1
    - git clone https://invent.kde.org/sysadmin/ci-utilities.git upstream-ci-utilities --depth=1

    - python3 -m venv venv --upgrade-deps
    - . venv/bin/activate
    - pip install -r krita-deps-management/requirements.txt
    # Reactivate venv to force it to use the pip version of meson
    - . venv/bin/activate
    # make sure venv doesn't take precedence over normal PATH search
    - unset VIRTUAL_ENV

    - if [ "$KRITACI_ANDROID_PACKAGE_TYPE" == "nightly" ]; then pip install -r ci-notary-service/requirements.txt; fi
  script:
    - git config --global --add safe.directory $CI_PROJECT_DIR
    - python3 -u krita-deps-management/tools/replace-branch-in-seed-file.py krita-deps-management/latest/krita-deps.yml -p -o branch-corrected-deps.yml -d $DEPS_BRANCH_NAME_ANDROID
    - python3 -u krita-deps-management/tools/generate-deps-file.py -s branch-corrected-deps.yml -o .kde-ci.yml
    - python3 -u krita-deps-management/ci-utilities/run-ci-build.py --project $CI_PROJECT_NAME --branch $CI_COMMIT_REF_NAME --platform Android/$KDECI_ANDROID_ABI/Qt5/Shared --only-build --skip-publishing 2>&1 | tee build-krita.log
    - python3 -u build-tools/ci-scripts/build-android-package.py 2>&1 | tee build-apk.log
    - if [ "$KRITACI_ANDROID_PACKAGE_TYPE" == "nightly" ]; then python3 -u ci-notary-service/signapk.py -v --config upstream-ci-utilities/signing/signapk.ini $KDECI_WORKDIR_PATH/krita/_packaging/*.apk 2>&1 | tee apk-sign.log ; fi
      # WARNING: we don't actually check if the package is signed or not, since the notary service
      # could "silently" skip signing due to security reasons
    - if [ "$KRITACI_ANDROID_PACKAGE_TYPE" == "nightly" ]; then python3 -u build-tools/ci-scripts/rename-signed-apk-packages.py --folder $KDECI_WORKDIR_PATH/krita/_packaging 2>&1 | tee apk-rename.log; fi
    - python3 -u build-tools/ci-scripts/upload-nightly-packages.py --platform android-$KDECI_ANDROID_ABI --folder $KDECI_WORKDIR_PATH/krita/_packaging 2>&1 | tee apk-publish.log
      # move the artifacts from the workdir to the ci-root, so that artifacts could be fetched
    - if [[ "$(realpath $KDECI_WORKDIR_PATH/krita/_packaging)" != "$(realpath $CI_PROJECT_DIR/_packaging)" ]]; then mv $KDECI_WORKDIR_PATH/krita/_packaging $CI_PROJECT_DIR/; fi
    - if [[ "$(realpath $KDECI_WORKDIR_PATH/krita/_build)" != "$(realpath $CI_PROJECT_DIR/_packaging)" ]]; then mv $KDECI_WORKDIR_PATH/krita/_build $CI_PROJECT_DIR/; fi

.android-nightly-base:
  extends:
    - .android-base
    - .weekly-job-mixin
    - .upload-packages-to-cdn-base-mixin
  variables:
    KRITACI_ANDROID_PACKAGE_TYPE: nightly
    KDECI_EXTRA_CMAKE_ARGS: >
      -DHIDE_SAFE_ASSERTS=OFF
      -DBUILD_TESTING=ON

.android-release-base:
  extends:
  - .android-base
  - .ci-release-job-mixin
  variables:
    KRITACI_ANDROID_PACKAGE_TYPE: release
    KRITACI_ANDROID_RELEASE_MODE: 1
    KDECI_EXTRA_CMAKE_ARGS: >
      -DHIDE_SAFE_ASSERTS=ON
      -DBUILD_TESTING=OFF

.android-x86_64-mixin:
  variables:
    KDECI_PACKAGE_PROJECT: teams/ci-artifacts/krita-android-x86_64
    KDECI_ANDROID_ABI: x86_64
    KDECI_CC_CACHE: /mnt/krita-android/x86_64/caches/
    KDECI_CACHE_PATH: /mnt/krita-android/x86_64/artifacts/
    KRITACI_ARCHIVE_ARTIFACTS: True
    KRITACI_SKIP_COMMON_ARTIFACTS: True

.android-arm64-v8a-mixin:
  variables:
    KDECI_PACKAGE_PROJECT: teams/ci-artifacts/krita-android-arm64-v8a
    KDECI_ANDROID_ABI: arm64-v8a
    KDECI_CC_CACHE: /mnt/krita-android/arm64-v8a/caches/
    KDECI_CACHE_PATH: /mnt/krita-android/arm64-v8a/artifacts/
    KRITACI_ARCHIVE_ARTIFACTS: True
    KRITACI_SKIP_COMMON_ARTIFACTS: False # only arm64-v8a packages common artifacts

.android-armeabi-v7a-mixin:
  variables:
    KDECI_PACKAGE_PROJECT: teams/ci-artifacts/krita-android-armeabi-v7a
    KDECI_ANDROID_ABI: armeabi-v7a
    KDECI_CC_CACHE: /mnt/krita-android/armeabi-v7a/caches/
    KDECI_CACHE_PATH: /mnt/krita-android/armeabi-v7a/artifacts/
    KRITACI_ARCHIVE_ARTIFACTS: True
    KRITACI_SKIP_COMMON_ARTIFACTS: True

android-build-appbundle:
  stage: deploy
  image: $VM_IMAGE_NAME_ANDROID
  tags:
    - VM
    - amd64
  extends:
    - .ci-manual-job-mixin
  interruptible: true
  needs:
    - job: android-build-armeabi-v7a
      artifacts: true
    - job: android-build-arm64-v8a
      artifacts: true
    - job: android-build-x86_64
      artifacts: true
  variables:
    KRITACI_ANDROID_PACKAGE_TYPE: debug
  script:
    - git config --global --add safe.directory $CI_PROJECT_DIR
    - python3 -u build-tools/ci-scripts/build-android-appbundle.py 2>&1 | tee build-aab.log
  artifacts:
    name: krita-$CI_COMMIT_REF_SLUG
    expire_in: 10 days
    when: always
    paths:
      - "_packaging/*.aab"
      - "*.log"

android-build-x86_64:
  extends:
  - .android-base
  - .android-x86_64-mixin

android-build-arm64-v8a:
  extends:
  - .android-base
  - .android-arm64-v8a-mixin

android-build-armeabi-v7a:
  extends:
  - .android-base
  - .android-armeabi-v7a-mixin

android-build-x86_64-nightly:
  extends:
  - .android-nightly-base
  - .android-x86_64-mixin

android-build-arm64-v8a-nightly:
  extends:
  - .android-nightly-base
  - .android-arm64-v8a-mixin

android-build-armeabi-v7a-nightly:
  extends:
  - .android-nightly-base
  - .android-armeabi-v7a-mixin

android-build-x86_64-release:
  extends:
  - .android-release-base
  - .android-x86_64-mixin

android-build-arm64-v8a-release:
  extends:
  - .android-release-base
  - .android-arm64-v8a-mixin

android-build-armeabi-v7a-release:
  extends:
  - .android-release-base
  - .android-armeabi-v7a-mixin

android-build-appbundle-release:
  extends:
    - android-build-appbundle
    - .ci-release-job-mixin
  interruptible: false
  needs:
    - job: android-build-armeabi-v7a-release
      artifacts: true
    - job: android-build-arm64-v8a-release
      artifacts: true
    - job: android-build-x86_64-release
      artifacts: true
  variables:
    KRITACI_ANDROID_PACKAGE_TYPE: release