Make travisCI publish binaries as release versions when tag is pushed.
This publish the same this that nightly build except that : - Use the `--make-release` option to force kiwix-build to use tagged version of subprojects. - The archives are named using the tag name. - The archives are pushed to "releases" directory in download.kiwix.org.
This commit is contained in:
parent
e4f8b6c7a9
commit
bb5b85da50
|
@ -4,21 +4,35 @@ set -e
|
||||||
|
|
||||||
BASE_DIR="BUILD_${PLATFORM}"
|
BASE_DIR="BUILD_${PLATFORM}"
|
||||||
NIGHTLY_ARCHIVES_DIR=${HOME}/NIGHTLY_ARCHIVES
|
NIGHTLY_ARCHIVES_DIR=${HOME}/NIGHTLY_ARCHIVES
|
||||||
|
RELEASE_ARCHIVES_DIR=${HOME}/RELEASE_ARCHIVES
|
||||||
SSH_KEY=${TRAVIS_BUILD_DIR}/travis/travisci_builder_id_key
|
SSH_KEY=${TRAVIS_BUILD_DIR}/travis/travisci_builder_id_key
|
||||||
|
|
||||||
mkdir -p ${NIGHTLY_ARCHIVES_DIR}
|
mkdir -p ${NIGHTLY_ARCHIVES_DIR}
|
||||||
|
mkdir -p ${RELEASE_ARCHIVES_DIR}
|
||||||
|
|
||||||
function make_nightly_archive {
|
function make_archive {
|
||||||
ARCHIVE_NAME="${1}_$(date +%Y-%m-%d).tar.gz"
|
if [[ "$MAKE_RELEASE" == "0" ]]
|
||||||
|
then
|
||||||
|
ARCHIVE_PATH="${NIGHTLY_ARCHIVES_DIR}/${1}_$(date +%Y-%m-%d).tar.gz"
|
||||||
|
else
|
||||||
|
ARCHIVE_PATH="${RELEASE_ARCHIVES_DIR}/${1}-${TRAVIS_TAG}.tar.gz"
|
||||||
|
fi
|
||||||
(
|
(
|
||||||
cd ${BASE_DIR}/INSTALL/bin
|
cd ${BASE_DIR}/INSTALL/bin
|
||||||
tar -czf "${NIGHTLY_ARCHIVES_DIR}/$ARCHIVE_NAME" $2
|
tar -czf "${ARCHIVE_PATH}" $2
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
cd ${HOME}
|
cd ${HOME}
|
||||||
|
|
||||||
if [[ "$TRAVIS_EVENT_TYPE" = "cron" ]]
|
if [[ $TRAVIS_TAG =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ ]]
|
||||||
|
then
|
||||||
|
MAKE_RELEASE=1
|
||||||
|
else
|
||||||
|
MAKE_RELEASE=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$TRAVIS_EVENT_TYPE" == "cron" || "$MAKE_RELEASE" == "1" ]]
|
||||||
then
|
then
|
||||||
if [[ ${PLATFORM} = android* ]]
|
if [[ ${PLATFORM} = android* ]]
|
||||||
then
|
then
|
||||||
|
@ -33,23 +47,25 @@ then
|
||||||
for TARGET in ${TARGETS}
|
for TARGET in ${TARGETS}
|
||||||
do
|
do
|
||||||
echo $TARGET
|
echo $TARGET
|
||||||
${TRAVIS_BUILD_DIR}/kiwix-build.py \
|
if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]
|
||||||
--target-platform $PLATFORM \
|
then
|
||||||
--build-deps-only \
|
${TRAVIS_BUILD_DIR}/kiwix-build.py \
|
||||||
--hide-progress \
|
--target-platform $PLATFORM \
|
||||||
${TARGET}
|
--build-deps-only \
|
||||||
rm ${BASE_DIR}/.install_packages_ok
|
--hide-progress \
|
||||||
|
${TARGET}
|
||||||
|
rm ${BASE_DIR}/.install_packages_ok
|
||||||
|
|
||||||
(
|
(
|
||||||
cd ${BASE_DIR}
|
cd ${BASE_DIR}
|
||||||
if [ -f meson_cross_file.txt ]
|
if [ -f meson_cross_file.txt ]
|
||||||
then
|
then
|
||||||
MESON_FILE=meson_cross_file.txt
|
MESON_FILE=meson_cross_file.txt
|
||||||
fi
|
fi
|
||||||
ANDROID_NDK_DIR=$(find . -name "android-ndk*")
|
ANDROID_NDK_DIR=$(find . -name "android-ndk*")
|
||||||
ARCHIVE_NAME="deps_${PLATFORM}_${TARGET}.tar.gz"
|
ARCHIVE_NAME="deps_${PLATFORM}_${TARGET}.tar.gz"
|
||||||
|
|
||||||
cat <<EOF > manifest.txt
|
cat <<EOF > manifest.txt
|
||||||
${ARCHIVE_NAME}
|
${ARCHIVE_NAME}
|
||||||
*********************************
|
*********************************
|
||||||
|
|
||||||
|
@ -57,26 +73,37 @@ Dependencies archive for ${TARGET} on platform ${PLATFORM}
|
||||||
Generated at $(date)
|
Generated at $(date)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
tar -czf ${ARCHIVE_NAME} INSTALL manifest.txt ${MESON_FILE} ${ANDROID_NDK_DIR}
|
tar -czf ${ARCHIVE_NAME} INSTALL manifest.txt ${MESON_FILE} ${ANDROID_NDK_DIR}
|
||||||
scp -i ${SSH_KEY} ${ARCHIVE_NAME} nightlybot@download.kiwix.org:/var/www/tmp.kiwix.org/ci/
|
scp -i ${SSH_KEY} ${ARCHIVE_NAME} nightlybot@download.kiwix.org:/var/www/tmp.kiwix.org/ci/
|
||||||
)
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
${TRAVIS_BUILD_DIR}/kiwix-build.py --hide-progress --target-platform $PLATFORM ${TARGET}
|
if [[ "$MAKE_RELEASE" == "1" ]]
|
||||||
|
then
|
||||||
|
${TRAVIS_BUILD_DIR}/kiwix-build.py \
|
||||||
|
--hide-progress \
|
||||||
|
--make-release \
|
||||||
|
--target-platform $PLATFORM ${TARGET}
|
||||||
|
else
|
||||||
|
${TRAVIS_BUILD_DIR}/kiwix-build.py \
|
||||||
|
--hide-progress \
|
||||||
|
--target-platform $PLATFORM ${TARGET}
|
||||||
|
fi
|
||||||
rm ${BASE_DIR}/.install_packages_ok
|
rm ${BASE_DIR}/.install_packages_ok
|
||||||
done
|
done
|
||||||
|
|
||||||
# We have build every thing. Now create archives for public deployement.
|
# We have build every thing. Now create archives for public deployement.
|
||||||
case ${PLATFORM} in
|
case ${PLATFORM} in
|
||||||
native_static)
|
native_static)
|
||||||
make_nightly_archive kiwix_tools_linux64 "kiwix-install kiwix-manage kiwix-read kiwix-search kiwix-serve"
|
make_archive kiwix_tools_linux64 "kiwix-install kiwix-manage kiwix-read kiwix-search kiwix-serve"
|
||||||
make_nightly_archive zim-tools_linux64 "zimbench zimdump zimsearch zimdiff zimpatch zimsplit"
|
make_archive zim-tools_linux64 "zimbench zimdump zimsearch zimdiff zimpatch zimsplit"
|
||||||
make_nightly_archive zimwriterfs_linux64 "zimwriterfs"
|
make_archive zimwriterfs_linux64 "zimwriterfs"
|
||||||
;;
|
;;
|
||||||
win32_static)
|
win32_static)
|
||||||
make_nightly_archive kiwix-tools_win32 "kiwix-install.exe kiwix-manage.exe kiwix-read.exe kiwix-search.exe kiwix-serve.exe"
|
make_archive kiwix-tools_win32 "kiwix-install.exe kiwix-manage.exe kiwix-read.exe kiwix-search.exe kiwix-serve.exe"
|
||||||
;;
|
;;
|
||||||
armhf_static)
|
armhf_static)
|
||||||
make_nightly_archive kiwix-tools_armhf "kiwix-install kiwix-manage kiwix-read kiwix-search kiwix-serve"
|
make_archive kiwix-tools_armhf "kiwix-install kiwix-manage kiwix-read kiwix-search kiwix-serve"
|
||||||
;;
|
;;
|
||||||
android_*)
|
android_*)
|
||||||
APK_NAME="kiwix-${PLATFORM}"
|
APK_NAME="kiwix-${PLATFORM}"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
NIGHTLY_ARCHIVES_DIR=${HOME}/NIGHTLY_ARCHIVES
|
NIGHTLY_ARCHIVES_DIR=${HOME}/NIGHTLY_ARCHIVES
|
||||||
|
RELEASE_ARCHIVES_DIR=${HOME}/RELEASE_ARCHIVES
|
||||||
SSH_KEY=travis/travisci_builder_id_key
|
SSH_KEY=travis/travisci_builder_id_key
|
||||||
|
|
||||||
NIGHTLY_ARCHIVES=$(find $NIGHTLY_ARCHIVES_DIR -type f)
|
NIGHTLY_ARCHIVES=$(find $NIGHTLY_ARCHIVES_DIR -type f)
|
||||||
|
@ -12,3 +13,11 @@ then
|
||||||
${NIGHTLY_ARCHIVES} \
|
${NIGHTLY_ARCHIVES} \
|
||||||
nightlybot@download.kiwix.org:/var/www/download.kiwix.org/nightly/$(date +%Y-%m-%d)
|
nightlybot@download.kiwix.org:/var/www/download.kiwix.org/nightly/$(date +%Y-%m-%d)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
RELEASE_ARCHIVES=$(find $RELEASE_ARCHIVES_DIR -type f)
|
||||||
|
if [[ "x$RELEASE_ARCHIVES" != "x" ]]
|
||||||
|
then
|
||||||
|
scp -vrp -i ${SSH_KEY} \
|
||||||
|
${RELEASE_ARCHIVES} \
|
||||||
|
nightlybot@downoald.kiwix.org:/var/www/download.kiwix.org/releases
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue