()
| 1317 | |
| 1318 | let variantsToCheck = build.variants.length; |
| 1319 | let onVariantChecked = () => { |
| 1320 | if (--variantsToCheck !== 0 || task.endTime) |
| 1321 | return; |
| 1322 | |
| 1323 | // at this point we are sure that no apks were uploaded yet |
| 1324 | |
| 1325 | const releaseNotes = []; |
| 1326 | |
| 1327 | const changeLogVersionName = build.version.name; |
| 1328 | let changeLogText = changeLogVersionName + '\n\n' + 'https://t.me/tgx_android'; |
| 1329 | const productionFromToCommit = getFromToCommit(build, true); |
| 1330 | const viewSourceUrl = build.git.remoteUrl + '/tree/' + build.git.commit.long; |
| 1331 | if (productionFromToCommit) { |
| 1332 | const betaFromToCommit = getFromToCommit(build); |
| 1333 | if (betaFromToCommit && betaFromToCommit.commit_range !== productionFromToCommit.commit_range) { |
| 1334 | const betaDiffUrl = build.git.remoteUrl + '/compare/' + betaFromToCommit.commit_range; |
| 1335 | changeLogText += '\n\nChanges from ' + betaFromToCommit.from_version.name + ':\n'; |
| 1336 | changeLogText += betaDiffUrl; |
| 1337 | } |
| 1338 | const diffUrl = build.git.remoteUrl + '/compare/' + productionFromToCommit.commit_range; |
| 1339 | changeLogText += '\n\nChanges from ' + productionFromToCommit.from_version.name + ':\n'; |
| 1340 | changeLogText += diffUrl; |
| 1341 | build.fallbackReleaseNotes = diffUrl; |
| 1342 | if (build.pullRequestsMetadata || !empty(build.pullRequests)) { |
| 1343 | changeLogText += '\n\nThis version also includes these pull requests:'; |
| 1344 | if (build.pullRequestsMetadata) { |
| 1345 | build.pullRequestsMetadata.forEach((pullRequestMetadata) => { |
| 1346 | const pullRequestId = pullRequestMetadata.id; |
| 1347 | const pullRequest = build.pullRequests ? build.pullRequests[pullRequestId] : null; |
| 1348 | changeLogText += '\n'; |
| 1349 | changeLogText += build.git.remoteUrl + '/pull/' + pullRequestId + ' at ' + pullRequest.commit.short; |
| 1350 | }); |
| 1351 | } else if (!empty(build.pullRequests)) { |
| 1352 | const pullRequestIds = Object.keys(build.pullRequests); |
| 1353 | pullRequestIds.forEach((pullRequestId) => { |
| 1354 | const pullRequest = build.pullRequests[pullRequestId]; |
| 1355 | changeLogText += '\n'; |
| 1356 | changeLogText += build.git.remoteUrl + '/pull/' + pullRequestId + ' at ' + pullRequest.commit.short; |
| 1357 | }); |
| 1358 | } |
| 1359 | } |
| 1360 | } else { |
| 1361 | build.fallbackReleaseNotes = 'This version is based on this source code: ' + viewSourceUrl; |
| 1362 | } |
| 1363 | releaseNotes.push({ |
| 1364 | language: 'en-US', // TODO more languages via translations.telegram.org |
| 1365 | text: changeLogText |
| 1366 | }); |
| 1367 | build.releaseNotes = releaseNotes; |
| 1368 | |
| 1369 | onDone(0); |
| 1370 | }; |
| 1371 | |
| 1372 | for (let i = 0; i < build.variants.length; i++) { |
| 1373 | const variant = build.variants[i]; |
no test coverage detected