diff --git a/scripts/publish_linux_packages_to_kiwix.sh b/scripts/publish_linux_packages_to_kiwix.sh new file mode 100644 index 00000000..ef4e7830 --- /dev/null +++ b/scripts/publish_linux_packages_to_kiwix.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Script to upload Linux packages to download.kiwix.org +target="/data/download/release/kiwix-js-electron" +echo "Uploading the files to https://download.kiwix.org/$target/" +echo "ssh -o StrictHostKeyChecking=no -i ./scripts/ssh_key ci@download.kiwix.org mkdir -p $target" +for file in ./bld/Electron/* ; do + if [[ $file =~ \.(AppImage|deb|rpm)$ ]]; then + echo "scp -r -p -o StrictHostKeyChecking=no -i $file ci@download.kiwix.org:$target" + echo "Copied $file to $target" + fi +done \ No newline at end of file diff --git a/scripts/rewrite_app_version_number.sh b/scripts/rewrite_app_version_number.sh index a442a335..e531c261 100644 --- a/scripts/rewrite_app_version_number.sh +++ b/scripts/rewrite_app_version_number.sh @@ -8,9 +8,16 @@ # # This script can be tested manually by replacing ${INPUT_VERSION} and ${TAG_VERSION} # with test strings - + # Use the override value by preference VERSION=${INPUT_VERSION} +# If the script was launched by Cron, then there will be no INPUT_VERSION, so construct a nightly version number +if [[ "qq${CRON_LAUNCHED}" != "qq" ]]; then + COMMIT_ID=$(git rev-parse --short HEAD) + # Get version from init.js + VERSION="$(grep 'params\[.appVersion' www/js/init.js | sed -E "s/[^[:digit:]]+([^\"']+).*/\1/")" + VERSION="v$VERSION$COMMIT_ID" +fi if [[ $VERSION =~ ^v?[0-9.]+ ]]; then VERSION=$(sed 's/^v//' <<<"$VERSION") # Remove any leading v echo "Using the valid override input and setting version to $VERSION"