2021-05-03 19:30:36 +02:00
|
|
|
print_error() {
|
|
|
|
echo "[CI] ERROR: $1"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print_info() {
|
|
|
|
echo "[CI] INFO: $1"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
check_failure() {
|
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
|
if [ -z $1 ] ; then
|
|
|
|
print_error $1
|
|
|
|
else
|
|
|
|
print_error "Failure exit code is detected."
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
if [[ "$DEPLOY" == "true" ]]; then
|
|
|
|
../scripts/macfixqtdylibrpath.py $TRAVIS_BUILD_DIR/build/src/app/valentina/bin/Valentina.app;
|
|
|
|
check_failure "Unable to patch the app bundle.";
|
|
|
|
|
|
|
|
if [[ "$LEGACY" = false ]]; then
|
2021-05-14 08:42:52 +02:00
|
|
|
legacy_suffix=""
|
2021-05-03 19:30:36 +02:00
|
|
|
else
|
2021-05-14 08:42:52 +02:00
|
|
|
legacy_suffix="-legacy"
|
2021-05-03 19:30:36 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
print_info "Start compressing.";
|
2021-09-13 16:57:00 +02:00
|
|
|
tar -C $TRAVIS_BUILD_DIR/build/src/app/valentina/bin --exclude "*.DS_Store" -cvJf valentina-osx-${XCODE}-${TRAVIS_COMMIT}${legacy_suffix}.tar.xz Valentina.app/;
|
2021-05-03 19:30:36 +02:00
|
|
|
check_failure "Unable to create an archive.";
|
|
|
|
|
|
|
|
print_info "Start uploading.";
|
2021-09-13 16:57:00 +02:00
|
|
|
python3 $TRAVIS_BUILD_DIR/scripts/deploy.py upload $ACCESS_TOKEN $TRAVIS_BUILD_DIR/build/valentina-osx-${XCODE}-${TRAVIS_COMMIT}${legacy_suffix}.tar.xz "/0.7.x/Mac OS X/valentina-osx-${XCODE}-${TRAVIS_COMMIT}${legacy_suffix}.tar.xz";
|
2021-05-03 19:30:36 +02:00
|
|
|
check_failure "Unable to upload.";
|
|
|
|
|
|
|
|
print_info "Successfully uploaded.";
|
|
|
|
else
|
|
|
|
print_info "No deployment needed.";
|
|
|
|
fi
|