sendBuildStepNotification method
Send build step notification
Implementation
Future<void> sendBuildStepNotification({
required String step,
required String client,
required String platform,
required String status, // started, completed, failed
String? additionalInfo,
String? errorMessage,
}) async {
String emoji;
String color;
String message;
switch (status.toLowerCase()) {
case 'started':
emoji = ':rocket:';
color = '#36a64f'; // green
message = 'Build step started';
break;
case 'completed':
emoji = ':white_check_mark:';
color = 'good';
message = 'Build step completed successfully';
break;
case 'failed':
emoji = ':x:';
color = 'danger';
message = 'Build step failed';
break;
default:
emoji = ':information_source:';
color = 'warning';
message = 'Build step update';
}
final fields = <String, String>{
'Client': client,
'Platform': platform,
'Step': step,
'Status': status.toUpperCase(),
};
if (additionalInfo != null) {
fields['Info'] = additionalInfo;
}
if (errorMessage != null) {
fields['Error'] = errorMessage;
}
final success = await sendRichMessage(
title: '$emoji Build Update - $step',
message: message,
color: color,
fields: fields,
);
if (!success) {
print('⚠️ Failed to send build step notification for: $step');
}
}