aboutsummaryrefslogtreecommitdiff
path: root/scripts/upload.sh
blob: 53c45b4de118c4c41d62ed2e9b8655459ff5b36e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash

set -e


if [ "$#" -ne 3 ]; then
	echo "Usage: $0 <project_name> <build_directory> <upload_location>"
	exit 1
fi

project_name="$1"
build_directory="$2"
upload_location="$3"

app_path="${build_directory}/${project_name}.app"
app_version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ${app_path}/Contents/Info.plist)
build_number=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${app_path}/Contents/Info.plist)
dmg_path="${build_directory}/${project_name}-${app_version}.dmg"

echo "Uploading ${dmg_path} to ${upload_location}"
rsync -avz "${dmg_path}" "${upload_location}"
rsync -avz "${dmg_path}".minisig "${upload_location}"

for delta_file in "${build_directory}/${project_name}${build_number}"-*.delta; do
    if [ -f "$delta_file" ]; then
				echo "Uploading ${delta_file} to ${upload_location}"
        rsync -avz "$delta_file" "${upload_location}"
        if [ -f "${delta_file}.minisig" ]; then
            rsync -avz "${delta_file}.minisig" "${upload_location}"
        fi
    fi
done