From 384b7d6a00248b70b15ac091c6160b61c8a16813 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 9 Apr 2020 23:38:13 +0200 Subject: [PATCH] [CI] Export dist archive before building other project. With the commit fb07b58 we are not skiping the compile/build process of meson project. As meson projects first remove the build directory before configuring, we remove dist archives that could have been generated before. Copy the dist archive in the export so we are ok. --- travis/compile_all.py | 57 ++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/travis/compile_all.py b/travis/compile_all.py index 7dce05e..aac2c48 100755 --- a/travis/compile_all.py +++ b/travis/compile_all.py @@ -321,6 +321,31 @@ def download_base_archive(base_name): file.write(batch) return file_path +def export_dist(target): + if target in ('kiwix-lib', 'kiwix-tools', 'kiwix-desktop'): + out_dir = DIST_KIWIX_ARCHIVES_DIR + else: + out_dir = DIST_ZIM_ARCHIVES_DIR + + if target in main_project_versions: + try: + (out_dir/target).mkdir(parents=True) + except FileExistsError: + pass + + full_target_name = "{}-{}".format(target, main_project_versions[target]) + if target != 'kiwix-desktop': + in_file = BASE_DIR/full_target_name/'meson-dist'/'{}.tar.xz'.format( + full_target_name) + else: + in_file = BASE_DIR/full_target_name/'{}.tar.gz'.format(full_target_name) + if in_file.exists(): + print_message("Copying {} to {}", in_file, out_dir/target) + shutil.copy(str(in_file), str(out_dir/target)) + else: + print_message("No {} to copy.", in_file) + + if PLATFORM != 'flatpak': # The first thing we need to do is to (potentially) download already compiled base dependencies. base_dep_archive_name = "base_deps_{os}_{platform}_{version}_{release}.tar.xz".format( @@ -454,38 +479,10 @@ for target in TARGETS: platform=PLATFORM, make_release=True, make_dist=True) + export_dist(target) # We have build everything. Now create archives for public deployement. -if make_release and PLATFORM == 'native_dyn': - for target in TARGETS: - if release_versions.get(target) != 0: - # Do not release project not in release_versions - continue - if target in ('kiwix-lib', 'kiwix-tools', 'kiwix-desktop'): - out_dir = DIST_KIWIX_ARCHIVES_DIR - else: - out_dir = DIST_ZIM_ARCHIVES_DIR - - if target in ('kiwix-lib', 'kiwix-tools', 'libzim', 'zim-tools', 'zimwriterfs', 'kiwix-desktop'): - try: - (out_dir/target).mkdir(parents=True) - except FileExistsError: - pass - - full_target_name = "{}-{}".format(target, main_project_versions[target]) - if target != 'kiwix-desktop': - in_file = BASE_DIR/full_target_name/'meson-dist'/'{}.tar.xz'.format( - full_target_name) - else: - in_file = BASE_DIR/full_target_name/'{}.tar.gz'.format(full_target_name) - if in_file.exists(): - print_message("Copying {} to {}", in_file, out_dir/target) - shutil.copy(str(in_file), str(out_dir/target)) - else: - print_message("No {} to copy.", in_file) - print_message("{}\n", list((BASE_DIR/full_target_name).iterdir())) - print_message("{}\n", list((BASE_DIR/full_target_name/'meson-dist').iterdir())) -elif PLATFORM == 'native_mixed': +if PLATFORM == 'native_mixed': make_archive('libzim', 'linux-x86_64') elif PLATFORM == 'native_static': for target in ('kiwix-tools', 'zim-tools', 'zimwriterfs'):