diff options
| author | David Lönnhager <david.l@mullvad.net> | 2025-03-12 20:08:01 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2025-03-20 15:06:46 +0100 |
| commit | 7520c7138c37255396d263f54ada92a83d25beb5 (patch) | |
| tree | 81f7fd71428d47ae95685323ff2e04a585c420c5 | |
| parent | aa5db48005bf9d2bd9c010dbf6a509605b3eb164 (diff) | |
| download | mullvadvpn-7520c7138c37255396d263f54ada92a83d25beb5.tar.xz mullvadvpn-7520c7138c37255396d263f54ada92a83d25beb5.zip | |
Update buildserver-upload.sh
Changes:
- Handle checksums recursively in the upload directory
- Add 'desktop-downloader' platform for uploading installer-downloader
| -rwxr-xr-x | ci/buildserver-upload.sh | 29 | ||||
| -rwxr-xr-x | installer-downloader/build.sh | 2 |
2 files changed, 19 insertions, 12 deletions
diff --git a/ci/buildserver-upload.sh b/ci/buildserver-upload.sh index fde7c192b8..f09ae11ea0 100755 --- a/ci/buildserver-upload.sh +++ b/ci/buildserver-upload.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eu -shopt -s nullglob +shopt -s nullglob globstar CODE_SIGNING_KEY_FINGERPRINT="A1198702FC3E0A09A9AE5B75D5A1D4F266DE8DDF" @@ -23,35 +23,42 @@ function rsync_upload { while true; do sleep 10 - for checksums_path in *.sha256; do + for checksums_path in **/*.sha256; do sleep 1 + checksums_dir=$(dirname "$checksums_path") + checksums_filename=$(basename "$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 + platform="$(echo "$checksums_filename" | cut -d + -f 1)" + version="$(echo "$checksums_filename" | cut -d + -f 3,4 | sed 's/\.sha256//')" + if ! (cd "$checksums_dir" && sha256sum --quiet -c "$checksums_filename"); then echo "Failed to verify checksums for $version" continue fi - if [[ $version == *"-dev-"* ]]; then + if [[ "$platform" == "installer-downloader" ]]; then + upload_path="desktop/installer-downloader" + elif [[ $version == *"-dev-"* ]]; then upload_path="$platform/builds" else upload_path="$platform/releases" fi - files=$(awk '{print $2}' < "$checksums_path") - for file in $files; do + readarray -t files < <(cut -f 2- -d ' ' < "$checksums_path" | sed 's/^\*\(.*\)/\1/') + for filename in "${files[@]}"; do + file="$checksums_dir/$filename" + file_upload_dir="$upload_path/$version" - if [[ $platform == "desktop" && ! $file == MullvadVPN-* ]]; then + if [[ $platform == "desktop" && ! $filename == MullvadVPN-* ]]; then file_upload_dir="$file_upload_dir/additional-files" - elif [[ $platform == "android" && ! $file =~ MullvadVPN-"$version"(.apk|.play.apk|.play.aab) ]]; then + elif [[ $platform == "android" && ! $filename =~ MullvadVPN-"$version"(.apk|.play.apk|.play.aab) ]]; then file_upload_dir="$file_upload_dir/additional-files" fi rsync_upload "$file" "$file_upload_dir/" || continue - if [[ $file == MullvadVPN-* ]]; then + if [[ $filename == MullvadVPN-* || $filename == Install* ]]; then rm -f "$file.asc" gpg -u $CODE_SIGNING_KEY_FINGERPRINT --pinentry-mode loopback --sign --armor --detach-sign "$file" rsync_upload "$file.asc" "$file_upload_dir/" || continue diff --git a/installer-downloader/build.sh b/installer-downloader/build.sh index fe6148e291..576a9e2dc8 100755 --- a/installer-downloader/build.sh +++ b/installer-downloader/build.sh @@ -346,7 +346,7 @@ function upload { local files=( "$FILENAME."* ) local checksums_path - checksums_path="desktop-downloader+$(hostname)+$version.sha256" + checksums_path="installer-downloader+$(hostname)+$version.sha256" sha256sum "${files[@]}" > "$checksums_path" |
