diff --git a/bin/publish-latest-branch-build.php b/bin/publish-latest-branch-build.php index da775e3..4a4c839 100755 --- a/bin/publish-latest-branch-build.php +++ b/bin/publish-latest-branch-build.php @@ -1,234 +1,242 @@ #!/usr/bin/env php getTelegramCommentLines() as $apk_line) { $telegram_apk_lines[] = $apk_line; $telegram_apk_lines[] = ""; } foreach ($generated_apk->getPhorgeCommentLines() as $apk_line) { $phorge_apk_lines[] = $apk_line; $phorge_apk_lines[] = ""; } } $telegram_apk_lines_str = implode("\n", $telegram_apk_lines); $phorge_apk_lines_str = implode("\n", $phorge_apk_lines); // add a comment to the build URL if (!empty($phorge_document_id) && empty(getenv('NO_COMMENT'))) { // We have a Differentials revision under review! $telegram_chat_content = implode("\n", [ // In Telegram, normal text must be escaped. Link destinations must not be escaped. TelegramStupidSDK::escapeMarkdownV2("⚙ Dear Android hackers, please review this promising patch:"), TelegramStupidSDK::escapeMarkdownV2("https://gitpull.it/$phorge_document_id"), "", TelegramStupidSDK::escapeMarkdownV2("Here the related fresh test builds:"), "", // The texts in these links are already escaped. $telegram_apk_lines_str, ]); // Send message to Telegram groups. echo "DEBUG TELEGRAM CONTENT\n"; echo "$telegram_chat_content\n"; // Send message to your default Telegram group. // See the TELEGRAM_* environment variables. (new TelegramStupidSDK())->sendMessage($telegram_chat_content); // Send message to Phorge. echo "Adding bipbop Comment to $phorge_document_id\n"; shell_exec(sprintf( "~/bin/phab-comment.php %s %s %s", escapeshellarg($phorge_document_id), - escapeshellarg($apk_destination_url), - escapeshellarg($apk_sha256) + escapeshellarg($apk_aligned_signed_url), + escapeshellarg($apk_raw_sha256) )); } else { // We have NOT a Differentials revision under review! // So this is an atomic commit. $telegram_chat_content = implode("\n", [ "🌚 New commit: *$git_commit_title*", "https://gitpull.it/R4:$git_commit", "", "Here the related fresh test builds:", "", $telegram_apk_lines_str, ]); echo "DEBUG TELEGRAM CONTENT\n"; echo "$telegram_chat_content\n"; // Send message to your default Telegram group. // See the TELEGRAM_* environment variables. (new TelegramStupidSDK())->sendMessage($telegram_chat_content); } // delete very old files print_log_info("Cleaning old artifacts"); shell_exec(sprintf( "find %s -type f -mtime +120 -delete", escapeshellarg($ARTIFACTS_PATH) )); print_log_info("Done");