Skip to content

Commit 55b83ad

Browse files
cleaned up what's new
1 parent 4834b18 commit 55b83ad

4 files changed

Lines changed: 21 additions & 31 deletions

File tree

dist/index.js

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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');

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AppStoreConnectClient.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -236,44 +236,39 @@ async function updateBetaBuildLocalization(betaBuildLocalization: BetaBuildLocal
236236
return betaBuildLocalization;
237237
}
238238

239-
async function pollForValidBuild(project: XcodeProject, buildVersion: string, maxRetries: number = 60, interval: number = 30): Promise<Build> {
239+
async function pollForValidBuild(project: XcodeProject, maxRetries: number = 60, interval: number = 30): Promise<Build> {
240240
core.info(`Polling build validation...`);
241241
let retries = 0;
242242
while (retries < maxRetries) {
243-
if (core.isDebug()) {
244-
log(`Polling for build... Attempt ${++retries}/${maxRetries}`);
245-
}
243+
core.info(`Polling for build... Attempt ${++retries}/${maxRetries}`);
246244
let { preReleaseVersion, build } = await getLastPreReleaseVersionAndBuild(project);
247245
if (!preReleaseVersion) {
248-
throw new Error(`preReleaseVersion ${buildVersion} not found!`);
246+
throw new Error(`Failed to get the last pre-release for version ${project.versionString}!`);
249247
}
250248
if (!build) {
251249
build = await getLastPrereleaseBuild(preReleaseVersion);
252250
}
253251
if (!build) {
254-
throw new Error(`Build ${buildVersion} not found!`);
255-
}
256-
if (build.attributes?.version !== buildVersion.toString()) {
257-
throw new Error(`Build version ${build.attributes?.version} does not match expected version ${buildVersion}`);
252+
throw new Error(`Build ${preReleaseVersion.id} not found!`);
258253
}
259254
switch (build.attributes?.processingState) {
260255
case 'VALID':
261256
return build;
262257
case 'FAILED':
263258
case 'INVALID':
264-
throw new Error(`Build ${buildVersion} is ${build.attributes?.processingState}!`);
259+
throw new Error(`Build ${build.attributes.version} is ${build.attributes.processingState}!`);
265260
default:
266-
log(`Build ${buildVersion} is ${build.attributes?.processingState}...`);
261+
core.info(`Build ${build.attributes.version} is ${build.attributes.processingState}...`);
267262
break;
268263
}
269264
await new Promise(resolve => setTimeout(resolve, interval * 1000));
270265
}
271266
throw new Error('Timed out waiting for valid build!');
272267
}
273268

274-
export async function UpdateTestDetails(project: XcodeProject, buildVersion: string, whatsNew: string): Promise<void> {
269+
export async function UpdateTestDetails(project: XcodeProject, whatsNew: string): Promise<void> {
275270
await getOrCreateClient(project);
276-
const build = await pollForValidBuild(project, buildVersion);
271+
const build = await pollForValidBuild(project);
277272
const betaBuildLocalization = await getBetaBuildLocalization(build);
278273
if (!betaBuildLocalization) {
279274
await createBetaBuildLocalization(build, whatsNew);

src/xcode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ export async function UploadApp(projectRef: XcodeProject) {
745745
try {
746746
const whatsNew = await getWhatsNew();
747747
core.info(`Uploading test details...\n${whatsNew}`);
748-
await UpdateTestDetails(projectRef, projectRef.bundleVersion, whatsNew);
748+
await UpdateTestDetails(projectRef, whatsNew);
749749
} catch (error) {
750750
log(`Failed to upload test details!\n${error}`, 'error');
751751
}

0 commit comments

Comments
 (0)