From 01e8f9234897146179a68f98611c87cafb4d0690 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 8 Mar 2022 14:42:45 +0100 Subject: [PATCH] Build the projects in the CI. We used to build only the base dependencies in the CI (and build the projects in nightly&Release workflow). Now always build the projects. --- .github/scripts/build_projects.py | 47 +++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 15 ++++++++++ 2 files changed, 62 insertions(+) create mode 100755 .github/scripts/build_projects.py diff --git a/.github/scripts/build_projects.py b/.github/scripts/build_projects.py new file mode 100755 index 0000000..5217fe8 --- /dev/null +++ b/.github/scripts/build_projects.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 + + +from common import ( + run_kiwix_build, + make_archive, + create_desktop_image, + fix_macos_rpath, + OS_NAME, + PLATFORM_TARGET, + DESKTOP, + notarize_macos_build, +) + +if PLATFORM_TARGET.startswith("android_"): + TARGETS = ("libkiwix",) +elif PLATFORM_TARGET.startswith("iOS"): + TARGETS = ("libzim", "libkiwix") +elif PLATFORM_TARGET.startswith("native_"): + if OS_NAME == "osx": + if PLATFORM_TARGET == "native_mixed": + TARGETS = ("libzim", ) + else: + TARGETS = ("libzim", "zim-tools", "libkiwix") + else: + if DESKTOP: + TARGETS = ("kiwix-desktop",) + elif PLATFORM_TARGET == "native_mixed": + TARGETS = ("libzim",) + else: + TARGETS = ("zim-tools", "libkiwix", "kiwix-tools") +elif PLATFORM_TARGET in ("win32_static", "armhf_static", "i586_static"): + TARGETS = ("kiwix-tools",) +elif PLATFORM_TARGET == "flatpak": + TARGETS = ("kiwix-desktop",) +else: + TARGETS = ("libzim", "zim-tools", "libkiwix", "kiwix-tools") + +for target in TARGETS: + run_kiwix_build(target, platform=PLATFORM_TARGET) + if target == "kiwix-desktop": + create_desktop_image(make_release=False) + else: + if PLATFORM_TARGET == "native_mixed" and OS_NAME == "osx": + fix_macos_rpath(target) + notarize_macos_build(target) + make_archive(target, make_release=False) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c69f45..c54a4c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,7 @@ jobs: needs: Docker container: image: "kiwix/kiwix-build_ci:${{matrix.image_variant}}-31" + options: "--device /dev/fuse --privileged" steps: - name: Checkout code shell: bash @@ -97,6 +98,13 @@ jobs: kiwix-build/.github/scripts/compile_all_deps.py env: PLATFORM_TARGET: ${{matrix.target}} + - name: Build projects + shell: bash + run: | + cd $HOME + kiwix-build/.github/scripts/build_projects.py + env: + PLATFORM_TARGET: ${{matrix.target}} - name: Upload failure logs if: failure() run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.sh @@ -153,6 +161,13 @@ jobs: $GITHUB_WORKSPACE/.github/scripts/compile_all_deps.py env: PLATFORM_TARGET: ${{matrix.target}} + - name: Build projects + shell: bash + run: | + cd $HOME + $GITHUB_WORKSPACE/.github/scripts/build_projects.py + env: + PLATFORM_TARGET: ${{matrix.target}} - name: Upload failure logs if: failure() run: $GITHUB_WORKSPACE/.github/scripts/upload_failure_logs.sh