Output published release name on success

This commit is contained in:
Jack Boswell (boswelja)
2020-12-01 17:53:30 +13:00
parent 3ea191f69b
commit 373fb32d65
4 changed files with 24 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
@@ -80,6 +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}`);
core.setOutput("releaseName", getPublishedReleaseName(res.data, options));
return Promise.resolve(res.data.id);
}
else {
@@ -249,3 +250,13 @@ function uploadBundle(appEdit, options, bundleReleaseFile) {
return res.data;
});
}
function getPublishedReleaseName(appEdit, options) {
return __awaiter(this, void 0, void 0, function* () {
const track = yield androidPublisher.edits.tracks.get({
editId: appEdit.id,
track: options.track
});
const release = track.data.releases[0]; // We only ever create one release, so grab the first one
return release.name;
});
}

View File

@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};

View File

@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};