diff --git a/scripts/publish_linux_packages_to_kiwix.sh b/scripts/publish_linux_packages_to_kiwix.sh index ef4e7830..2bf0df42 100644 --- a/scripts/publish_linux_packages_to_kiwix.sh +++ b/scripts/publish_linux_packages_to_kiwix.sh @@ -1,12 +1,16 @@ #!/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" +if [[ "qq${CRON_LAUNCHED}" != "qq" ]]; then + echo "This script was launched by the GitHub Cron proces" + CURRENT_DATE=$(date +'%Y-%m-%d') + target="/data/download/nightly/$CURRENT_DATE" +fi +echo "Uploading packages to https://download.kiwix.org/$target/" +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" + scp -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 e531c261..96a4d250 100644 --- a/scripts/rewrite_app_version_number.sh +++ b/scripts/rewrite_app_version_number.sh @@ -13,10 +13,11 @@ 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 + echo "This script was launched by the GitHub Cron job" 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" + VERSION="v$VERSION-$COMMIT_ID" fi if [[ $VERSION =~ ^v?[0-9.]+ ]]; then VERSION=$(sed 's/^v//' <<<"$VERSION") # Remove any leading v