@@ -57679,44 +57679,39 @@ async function updateBetaBuildLocalization(betaBuildLocalization, whatsNew) {
5767957679 (0, utilities_1.log)(responseJson);
5768057680 return betaBuildLocalization;
5768157681}
57682- async function pollForValidBuild(project, buildVersion, maxRetries = 60, interval = 30) {
57683- var _a, _b, _c, _d, _e ;
57682+ async function pollForValidBuild(project, maxRetries = 60, interval = 30) {
57683+ var _a;
5768457684 core.info(`Polling build validation...`);
5768557685 let retries = 0;
5768657686 while (retries < maxRetries) {
57687- if (core.isDebug()) {
57688- (0, utilities_1.log)(`Polling for build... Attempt ${++retries}/${maxRetries}`);
57689- }
57687+ core.info(`Polling for build... Attempt ${++retries}/${maxRetries}`);
5769057688 let { preReleaseVersion, build } = await getLastPreReleaseVersionAndBuild(project);
5769157689 if (!preReleaseVersion) {
57692- throw new Error(`preReleaseVersion ${buildVersion} not found !`);
57690+ throw new Error(`Failed to get the last pre-release for version ${project.versionString} !`);
5769357691 }
5769457692 if (!build) {
5769557693 build = await getLastPrereleaseBuild(preReleaseVersion);
5769657694 }
5769757695 if (!build) {
57698- throw new Error(`Build ${buildVersion} not found!`);
57699- }
57700- if (((_a = build.attributes) === null || _a === void 0 ? void 0 : _a.version) !== buildVersion.toString()) {
57701- throw new Error(`Build version ${(_b = build.attributes) === null || _b === void 0 ? void 0 : _b.version} does not match expected version ${buildVersion}`);
57696+ throw new Error(`Build ${preReleaseVersion.id} not found!`);
5770257697 }
57703- switch ((_c = build.attributes) === null || _c === void 0 ? void 0 : _c .processingState) {
57698+ switch ((_a = build.attributes) === null || _a === void 0 ? void 0 : _a .processingState) {
5770457699 case 'VALID':
5770557700 return build;
5770657701 case 'FAILED':
5770757702 case 'INVALID':
57708- throw new Error(`Build ${buildVersion } is ${(_d = build.attributes) === null || _d === void 0 ? void 0 : _d .processingState}!`);
57703+ throw new Error(`Build ${build.attributes.version } is ${build.attributes.processingState}!`);
5770957704 default:
57710- (0, utilities_1.log) (`Build ${buildVersion } is ${(_e = build.attributes) === null || _e === void 0 ? void 0 : _e .processingState}...`);
57705+ core.info (`Build ${build.attributes.version } is ${build.attributes.processingState}...`);
5771157706 break;
5771257707 }
5771357708 await new Promise(resolve => setTimeout(resolve, interval * 1000));
5771457709 }
5771557710 throw new Error('Timed out waiting for valid build!');
5771657711}
57717- async function UpdateTestDetails(project, buildVersion, whatsNew) {
57712+ async function UpdateTestDetails(project, whatsNew) {
5771857713 await getOrCreateClient(project);
57719- const build = await pollForValidBuild(project, buildVersion );
57714+ const build = await pollForValidBuild(project);
5772057715 const betaBuildLocalization = await getBetaBuildLocalization(build);
5772157716 if (!betaBuildLocalization) {
5772257717 await createBetaBuildLocalization(build, whatsNew);
@@ -58702,7 +58697,7 @@ async function UploadApp(projectRef) {
5870258697 try {
5870358698 const whatsNew = await getWhatsNew();
5870458699 core.info(`Uploading test details...\n${whatsNew}`);
58705- await (0, AppStoreConnectClient_1.UpdateTestDetails)(projectRef, projectRef.bundleVersion, whatsNew);
58700+ await (0, AppStoreConnectClient_1.UpdateTestDetails)(projectRef, whatsNew);
5870658701 }
5870758702 catch (error) {
5870858703 (0, utilities_1.log)(`Failed to upload test details!\n${error}`, 'error');
0 commit comments