Skip to content

Commit

Permalink
Add multiple urls to internal sharing outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lriccardo committed Dec 23, 2020
1 parent b06f374 commit e9a4446
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
15 changes: 11 additions & 4 deletions lib/edits.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@ function uploadToPlayStore(options, releaseFiles) {
// Check the 'track' for 'internalsharing', if so switch to a non-track api
if (options.track === 'internalsharing') {
core.debug("Track is Internal app sharing, switch to special upload api");
let downloadUrls = []
for (const releaseFile of releaseFiles) {
core.debug(`Uploading ${releaseFile}`);
yield uploadInternalSharingRelease(options, releaseFile).catch(reason => {
core.setFailed(reason);
return Promise.reject(reason);
});
yield uploadInternalSharingRelease(options, releaseFile)
.then(downloadUrl => {
downloadUrls.push(downloadUrl)
})
.catch(reason => {
core.setFailed(reason);
return Promise.reject(reason);
});
}
core.setOutput("internalSharingDownloadUrls", downloadUrls);
core.exportVariable("INTERNAL_SHARING_DOWNLOAD_URLS", downloadUrls);
}
else {
// Create a new Edit
Expand Down
15 changes: 11 additions & 4 deletions src/edits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,20 @@ export async function uploadToPlayStore(options: EditOptions, releaseFiles: stri
// Check the 'track' for 'internalsharing', if so switch to a non-track api
if (options.track === 'internalsharing') {
core.debug("Track is Internal app sharing, switch to special upload api")
let downloadUrls: string[] = []
for (const releaseFile of releaseFiles) {
core.debug(`Uploading ${releaseFile}`);
await uploadInternalSharingRelease(options, releaseFile).catch(reason => {
core.setFailed(reason);
return Promise.reject(reason);
});
await uploadInternalSharingRelease(options, releaseFile)
.then(downloadUrl => {
downloadUrls.push(downloadUrl as string)
})
.catch(reason => {
core.setFailed(reason);
return Promise.reject(reason);
});
}
core.setOutput("internalSharingDownloadUrls", downloadUrls);
core.exportVariable("INTERNAL_SHARING_DOWNLOAD_URLS", downloadUrls);
} else {
// Create a new Edit
core.info(`Creating a new Edit for this release`)
Expand Down

0 comments on commit e9a4446

Please sign in to comment.