valentina/scripts/cirrus-deploy.sh

47 lines
2.0 KiB
Bash
Raw Permalink Normal View History

2021-09-23 09:57:27 +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
print_info "Start labeling.";
if [[ "$MULTI_BUNDLE" == "false" ]]; then
2024-01-25 11:27:22 +01:00
mv $CIRRUS_WORKING_DIR/build/install-root/share/valentina.dmg $CIRRUS_WORKING_DIR/build/install-root/share/valentina-${TARGET_PLATFORM}-${QT_VERSION}-${ARCH}-${CIRRUS_BRANCH}-${CIRRUS_CHANGE_IN_REPO}.dmg;
else
2024-01-25 11:27:22 +01:00
mv $CIRRUS_WORKING_DIR/build/install-root/share/valentina.dmg $CIRRUS_WORKING_DIR/build/install-root/share/valentina-${TARGET_PLATFORM}-${QT_VERSION}-${ARCH}-${CIRRUS_BRANCH}-multibundle-${CIRRUS_CHANGE_IN_REPO}.dmg;
2023-02-17 13:49:53 +01:00
fi
check_failure "Unable to label Valentina DMG.";
2021-09-23 09:57:27 +02:00
2023-03-11 12:55:40 +01:00
print_info "Start cleaning.";
python3 $CIRRUS_WORKING_DIR/scripts/deploy.py clean $ACCESS_TOKEN;
check_failure "Unable to clean stale artifacts.";
2021-09-23 09:57:27 +02:00
print_info "Start uploading.";
2023-02-17 13:49:53 +01:00
if [[ "$MULTI_BUNDLE" == "false" ]]; then
2024-01-25 11:27:22 +01:00
python3 $CIRRUS_WORKING_DIR/scripts/deploy.py upload $ACCESS_TOKEN $CIRRUS_WORKING_DIR/build/install-root/share/valentina-${TARGET_PLATFORM}-${QT_VERSION}-${ARCH}-${CIRRUS_BRANCH}-${CIRRUS_CHANGE_IN_REPO}.dmg "/0.7.x/Mac OS X/valentina-${TARGET_PLATFORM}-${QT_VERSION}-${ARCH}-${CIRRUS_BRANCH}-${CIRRUS_CHANGE_IN_REPO}.dmg";
2023-02-17 13:49:53 +01:00
else
2024-01-25 11:27:22 +01:00
python3 $CIRRUS_WORKING_DIR/scripts/deploy.py upload $ACCESS_TOKEN $CIRRUS_WORKING_DIR/build/install-root/share/valentina-${TARGET_PLATFORM}-${QT_VERSION}-${ARCH}-${CIRRUS_BRANCH}-multibundle-${CIRRUS_CHANGE_IN_REPO}.dmg "/0.7.x/Mac OS X/valentina-${TARGET_PLATFORM}-${QT_VERSION}-${ARCH}-${CIRRUS_BRANCH}-multibundle-${CIRRUS_CHANGE_IN_REPO}.dmg";
2023-02-17 13:49:53 +01:00
fi
check_failure "Unable to upload Valentina DMG.";
2021-09-23 09:57:27 +02:00
print_info "Successfully uploaded.";
else
print_info "No deployment needed.";
fi