From af37686362bec68e7291ba9e4091ed92d8e9c75c Mon Sep 17 00:00:00 2001 From: "Jack Boswell (boswelja)" Date: Tue, 8 Dec 2020 16:52:47 +1300 Subject: [PATCH 1/4] Only fetch release name if the user didn't specify one This should improve performance when manually setting a release name --- lib/edits.js | 3 ++- src/edits.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/edits.js b/lib/edits.js index 6e181f2c..01201f85 100644 --- a/lib/edits.js +++ b/lib/edits.js @@ -80,7 +80,8 @@ function uploadToPlayStore(options, releaseFiles) { // Simple check to see whether commit was successful if (res.data.id != null) { core.debug(`Successfully committed ${res.data.id}`); - core.setOutput("releaseName", getPublishedReleaseName(res.data, options)); + const name = options.name || getPublishedReleaseName(res.data, options); + core.setOutput("releaseName", name); return Promise.resolve(res.data.id); } else { diff --git a/src/edits.ts b/src/edits.ts index e311bf40..ae9d252a 100644 --- a/src/edits.ts +++ b/src/edits.ts @@ -77,7 +77,8 @@ export async function uploadToPlayStore(options: EditOptions, releaseFiles: stri // Simple check to see whether commit was successful if (res.data.id != null) { core.debug(`Successfully committed ${res.data.id}`); - core.setOutput("releaseName", getPublishedReleaseName(res.data, options)) + const name = options.name || getPublishedReleaseName(res.data, options); + core.setOutput("releaseName", name) return Promise.resolve(res.data.id!); } else { core.setFailed(`Error ${res.status}: ${res.statusText}`); From e18996b17efe9a55b3266b2e7ee3726c40997e43 Mon Sep 17 00:00:00 2001 From: "Jack Boswell (boswelja)" Date: Tue, 8 Dec 2020 16:55:59 +1300 Subject: [PATCH 2/4] Update README to reflect the added output --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7099a50f..b378bf13 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ The mapping.txt file used to de-obfuscate your stack traces from crash reports ## Outputs +### `releaseName` + +The name of the release published to Google Play, which is generated on commit by default + ### `internalSharingDownloadUrl` The download url for an app that was uploaded using the `track` `internalsharing` From 350f04f6edf1646490cc2a127a33b108a3fa6023 Mon Sep 17 00:00:00 2001 From: "Jack Boswell (boswelja)" Date: Tue, 8 Dec 2020 16:56:23 +1300 Subject: [PATCH 3/4] Add await to getPublishedReleaseName --- src/edits.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/edits.ts b/src/edits.ts index ae9d252a..78602dc2 100644 --- a/src/edits.ts +++ b/src/edits.ts @@ -77,7 +77,7 @@ export async function uploadToPlayStore(options: EditOptions, releaseFiles: stri // Simple check to see whether commit was successful if (res.data.id != null) { core.debug(`Successfully committed ${res.data.id}`); - const name = options.name || getPublishedReleaseName(res.data, options); + const name = options.name || (await getPublishedReleaseName(res.data, options)); core.setOutput("releaseName", name) return Promise.resolve(res.data.id!); } else { From 8e8abbe01376cf0d3534a1787cf930e31c981ddc Mon Sep 17 00:00:00 2001 From: "Jack Boswell (boswelja)" Date: Tue, 8 Dec 2020 16:56:23 +1300 Subject: [PATCH 4/4] Add await to getPublishedReleaseName --- lib/edits.js | 2 +- src/edits.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/edits.js b/lib/edits.js index 01201f85..acf9cff4 100644 --- a/lib/edits.js +++ b/lib/edits.js @@ -80,7 +80,7 @@ function uploadToPlayStore(options, releaseFiles) { // Simple check to see whether commit was successful if (res.data.id != null) { core.debug(`Successfully committed ${res.data.id}`); - const name = options.name || getPublishedReleaseName(res.data, options); + const name = options.name || (yield getPublishedReleaseName(res.data, options)); core.setOutput("releaseName", name); return Promise.resolve(res.data.id); } diff --git a/src/edits.ts b/src/edits.ts index ae9d252a..78602dc2 100644 --- a/src/edits.ts +++ b/src/edits.ts @@ -77,7 +77,7 @@ export async function uploadToPlayStore(options: EditOptions, releaseFiles: stri // Simple check to see whether commit was successful if (res.data.id != null) { core.debug(`Successfully committed ${res.data.id}`); - const name = options.name || getPublishedReleaseName(res.data, options); + const name = options.name || (await getPublishedReleaseName(res.data, options)); core.setOutput("releaseName", name) return Promise.resolve(res.data.id!); } else {