From deb2650c1221399564efbb80f438a8070eb35cd9 Mon Sep 17 00:00:00 2001 From: Oskar Nyberg Date: Fri, 13 Oct 2023 10:55:59 +0200 Subject: [PATCH] Add platform to checksums file in buildserver-build scripts --- ci/buildserver-build-android.sh | 2 +- ci/buildserver-build.sh | 2 +- ci/buildserver-upload.sh | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ci/buildserver-build-android.sh b/ci/buildserver-build-android.sh index 5114c0e23182..6e3ee91ef0b1 100755 --- a/ci/buildserver-build-android.sh +++ b/ci/buildserver-build-android.sh @@ -22,7 +22,7 @@ function upload { version=$1 files=( * ) - checksums_path="$version+$(hostname).sha256" + checksums_path="android+$(hostname)+$version.sha256" sha256sum "${files[@]}" > "$checksums_path" mv "${files[@]}" "$checksums_path" "$UPLOAD_DIR/" diff --git a/ci/buildserver-build.sh b/ci/buildserver-build.sh index 99453caac002..a8f17460e7d6 100755 --- a/ci/buildserver-build.sh +++ b/ci/buildserver-build.sh @@ -56,7 +56,7 @@ function upload { version=$1 files=( * ) - checksums_path="$version+$(hostname).sha256" + checksums_path="desktop+$(hostname)+$version.sha256" sha256sum "${files[@]}" > "$checksums_path" case "$(uname -s)" in diff --git a/ci/buildserver-upload.sh b/ci/buildserver-upload.sh index 10ad13ff7d52..d024a60f23d4 100755 --- a/ci/buildserver-upload.sh +++ b/ci/buildserver-upload.sh @@ -21,18 +21,18 @@ while true; do for checksums_path in *.sha256; do sleep 1 - # Strip everything from the last "+" in the file name to only keep the version and tag (if - # present). - version="${checksums_path%+*}" + # Parse the platform name and version out of the filename of the checksums file. + platform="$(echo "$checksums_path" | cut -d + -f 1)" + version="$(echo "$checksums_path" | cut -d + -f 3,4 | sed 's/\.sha256//')" if ! sha256sum --quiet -c "$checksums_path"; then echo "Failed to verify checksums for $version" continue fi if [[ $version == *"-dev-"* ]]; then - upload_path="builds" + upload_path="$platform/builds" else - upload_path="releases" + upload_path="$platform/releases" fi files=$(awk '{print $2}' < "$checksums_path")