(build, targetFiles, accessToken, uploadUrl, authCode)
| 1619 | } |
| 1620 | |
| 1621 | async function uploadHuaweiApk (build, targetFiles, accessToken, uploadUrl, authCode) { |
| 1622 | const apkFilePath = targetFiles.apkFile.path; |
| 1623 | try { |
| 1624 | const apkFileStream = fs.createReadStream(apkFilePath); |
| 1625 | const form = new FormData(); |
| 1626 | form.append('file', apkFileStream); |
| 1627 | form.append('authCode', authCode); |
| 1628 | form.append('fileCount', '1'); |
| 1629 | const response = await postHuaweiForm(uploadUrl, form); |
| 1630 | if (response.statusCode !== 200) { |
| 1631 | console.error('AGC upload failed', response.statusCode, response.statusMessage, response.contentType, response.content); |
| 1632 | return null; |
| 1633 | } |
| 1634 | return JSON.parse(response.content); |
| 1635 | } catch (e) { |
| 1636 | console.error('Failed to upload huawei APK', e); |
| 1637 | return null; |
| 1638 | } |
| 1639 | } |
| 1640 | |
| 1641 | async function updateHuaweiAppFileInfo (build, targetFiles, accessToken, fileInfo) { |
| 1642 | try { |
no test coverage detected