Comment code a bit
This commit is contained in:
@@ -37,6 +37,7 @@ const whatsnew_1 = require("./whatsnew");
|
||||
const androidPublisher = googleapis_1.google.androidpublisher('v3');
|
||||
function uploadToPlayStore(options, releaseFiles) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Check the 'track' for 'internalsharing', if so switch to a non-track api
|
||||
if (options.track === 'internalappsharing') {
|
||||
core.debug("Track is Internal app sharing, switch to special upload api");
|
||||
releaseFiles.forEach((releaseFile) => __awaiter(this, void 0, void 0, function* () {
|
||||
@@ -48,15 +49,17 @@ function uploadToPlayStore(options, releaseFiles) {
|
||||
}));
|
||||
}
|
||||
else {
|
||||
// Create a new Edit
|
||||
const appEdit = yield androidPublisher.edits.insert({
|
||||
auth: options.auth,
|
||||
packageName: options.applicationId
|
||||
});
|
||||
// Validate the given track
|
||||
yield validateSelectedTrack(appEdit.data, options).catch(reason => {
|
||||
core.setFailed(reason);
|
||||
return Promise.reject(reason);
|
||||
});
|
||||
// Check the 'track' for 'internalsharing', if so switch to a non-track api
|
||||
// Upload artifacts to Google Play, and store their version codes
|
||||
var versionCodes = new Array();
|
||||
releaseFiles.forEach((releaseFile) => __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug(`Uploading ${releaseFile}`);
|
||||
@@ -66,12 +69,15 @@ function uploadToPlayStore(options, releaseFiles) {
|
||||
});
|
||||
versionCodes.push(versionCode);
|
||||
}));
|
||||
// Add the uploaded artifacts to the Edit track
|
||||
const track = addReleasesToTrack(appEdit.data, options, versionCodes);
|
||||
// Commit the pending Edit
|
||||
const res = yield androidPublisher.edits.commit({
|
||||
auth: options.auth,
|
||||
editId: appEdit.data.id,
|
||||
packageName: options.applicationId
|
||||
});
|
||||
// Simple check to see whether commit was successful
|
||||
if (res.data.id != null) {
|
||||
core.debug(`Successfully committed ${res.data.id}`);
|
||||
return Promise.resolve(res.data.id);
|
||||
|
||||
Reference in New Issue
Block a user