Merge pull request #248 from kiwix/extra_build_version
Do not overwrite release build archives.
This commit is contained in:
commit
2686d74a78
|
@ -1,3 +1,4 @@
|
||||||
|
# This file reference all the versions of the depedencies we use in kiwix-build.
|
||||||
|
|
||||||
main_project_versions = {
|
main_project_versions = {
|
||||||
'kiwix-lib': '2.0.2',
|
'kiwix-lib': '2.0.2',
|
||||||
|
@ -8,6 +9,23 @@ main_project_versions = {
|
||||||
'kiwix-desktop': '2.0-alpha2'
|
'kiwix-desktop': '2.0-alpha2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This dictionnary specify what we need to build at each release process.
|
||||||
|
# - Values are integer or None
|
||||||
|
# - If a project is not in the dict (or None), the project is not released.
|
||||||
|
# - If release_versions[project] == 0, this is the first time the project is
|
||||||
|
# build for this release, so publish src and build archives.
|
||||||
|
# - If release_versions[project] > 0, release only the build archive with a
|
||||||
|
# build postfix.
|
||||||
|
# To change this dictionnary, use the following algorithm:
|
||||||
|
# - If project version change, set release_versions[project] = 0
|
||||||
|
# - Else
|
||||||
|
# - If project depedencies have not change, remove project from release_versions
|
||||||
|
# - Else, increment the value. If no value was present, see in
|
||||||
|
# http://download.kiwikorg/releases what to set.
|
||||||
|
|
||||||
|
release_versions = {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# This is the "version" of the whole base_deps_versions dict.
|
# This is the "version" of the whole base_deps_versions dict.
|
||||||
# Change this when you change base_deps_versions.
|
# Change this when you change base_deps_versions.
|
||||||
|
|
|
@ -13,6 +13,7 @@ from urllib.error import URLError
|
||||||
|
|
||||||
from kiwixbuild.versions import (
|
from kiwixbuild.versions import (
|
||||||
main_project_versions,
|
main_project_versions,
|
||||||
|
release_versions,
|
||||||
base_deps_versions,
|
base_deps_versions,
|
||||||
base_deps_meta_version)
|
base_deps_meta_version)
|
||||||
|
|
||||||
|
@ -98,6 +99,12 @@ def run_kiwix_build(target, platform,
|
||||||
def create_app_image():
|
def create_app_image():
|
||||||
if make_release:
|
if make_release:
|
||||||
postfix = main_project_versions['kiwix-desktop']
|
postfix = main_project_versions['kiwix-desktop']
|
||||||
|
extra_postfix = release_versions.get('kiwix-desktop')
|
||||||
|
if extra_postfix is None:
|
||||||
|
# We should not make archives for release not wanted
|
||||||
|
return
|
||||||
|
if extra_postfix:
|
||||||
|
postfix = "{}-{}".format(postfix, extra_postfix)
|
||||||
archive_dir = RELEASE_KIWIX_ARCHIVES_DIR/'kiwix-desktop'
|
archive_dir = RELEASE_KIWIX_ARCHIVES_DIR/'kiwix-desktop'
|
||||||
src_dir = SOURCE_DIR/'kiwix-desktop_release'
|
src_dir = SOURCE_DIR/'kiwix-desktop_release'
|
||||||
else:
|
else:
|
||||||
|
@ -126,6 +133,12 @@ def make_archive(project, platform):
|
||||||
|
|
||||||
if make_release:
|
if make_release:
|
||||||
postfix = main_project_versions[project]
|
postfix = main_project_versions[project]
|
||||||
|
extra_postfix = release_versions.get(project)
|
||||||
|
if extra_postfix is None:
|
||||||
|
# We should not make archives for release not wanted
|
||||||
|
return
|
||||||
|
if extra_postfix:
|
||||||
|
postfix = "{}-{}".format(postfix, extra_postfix)
|
||||||
if project in ('kiwix-lib', 'kiwix-tools'):
|
if project in ('kiwix-lib', 'kiwix-tools'):
|
||||||
archive_dir = RELEASE_KIWIX_ARCHIVES_DIR/project
|
archive_dir = RELEASE_KIWIX_ARCHIVES_DIR/project
|
||||||
else:
|
else:
|
||||||
|
@ -322,7 +335,7 @@ for target in TARGETS:
|
||||||
make_release=make_release)
|
make_release=make_release)
|
||||||
if target == 'kiwix-desktop':
|
if target == 'kiwix-desktop':
|
||||||
create_app_image()
|
create_app_image()
|
||||||
if make_release and PLATFORM == 'native_dyn':
|
if make_release and PLATFORM == 'native_dyn' and release_versions.get(target) == 0:
|
||||||
run_kiwix_build(target,
|
run_kiwix_build(target,
|
||||||
platform=PLATFORM,
|
platform=PLATFORM,
|
||||||
make_release=True,
|
make_release=True,
|
||||||
|
@ -332,6 +345,9 @@ for target in TARGETS:
|
||||||
# We have build everything. Now create archives for public deployement.
|
# We have build everything. Now create archives for public deployement.
|
||||||
if make_release and PLATFORM == 'native_dyn':
|
if make_release and PLATFORM == 'native_dyn':
|
||||||
for target in TARGETS:
|
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'):
|
if target in ('kiwix-lib', 'kiwix-tools', 'kiwix-desktop'):
|
||||||
out_dir = DIST_KIWIX_ARCHIVES_DIR
|
out_dir = DIST_KIWIX_ARCHIVES_DIR
|
||||||
else:
|
else:
|
||||||
|
@ -346,6 +362,7 @@ if make_release and PLATFORM == 'native_dyn':
|
||||||
in_file = BASE_DIR/target/'meson-dist'/'{}-{}.tar.xz'.format(
|
in_file = BASE_DIR/target/'meson-dist'/'{}-{}.tar.xz'.format(
|
||||||
target,
|
target,
|
||||||
main_project_versions[target])
|
main_project_versions[target])
|
||||||
|
if in_file.exists():
|
||||||
shutil.copy(str(in_file), str(out_dir/target))
|
shutil.copy(str(in_file), str(out_dir/target))
|
||||||
elif PLATFORM == 'native_static':
|
elif PLATFORM == 'native_static':
|
||||||
for target in ('kiwix-tools', 'zim-tools', 'zimwriterfs'):
|
for target in ('kiwix-tools', 'zim-tools', 'zimwriterfs'):
|
||||||
|
|
Loading…
Reference in New Issue