Finished action
Adding the monolith node_modules dir for deployment
This commit is contained in:
42
lib/main.js
42
lib/main.js
@@ -16,16 +16,44 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const wait_1 = require("./wait");
|
||||
const edits_1 = require("./edits");
|
||||
const { google } = require('googleapis');
|
||||
const auth = new google.auth.GoogleAuth({
|
||||
scopes: ['https://www.googleapis.com/auth/androidpublisher']
|
||||
});
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const ms = core.getInput('milliseconds');
|
||||
console.log(`Waiting ${ms} milliseconds ...`);
|
||||
core.debug((new Date()).toTimeString());
|
||||
wait_1.wait(parseInt(ms));
|
||||
core.debug((new Date()).toTimeString());
|
||||
core.setOutput('time', new Date().toTimeString());
|
||||
const serviceAccountJson = core.getInput('serviceAccountJson', { required: true });
|
||||
const packageName = core.getInput('packageName', { required: true });
|
||||
const releaseFile = core.getInput('releaseFile', { required: true });
|
||||
const track = core.getInput('track', { required: true });
|
||||
const userFraction = core.getInput('userFraction', { required: false });
|
||||
const whatsNewDir = core.getInput('whatsNewDirectory', { required: false });
|
||||
const mappingFile = core.getInput('mappingFile', { required: false });
|
||||
// verify inputs
|
||||
let userFractionFloat = parseFloat(userFraction);
|
||||
if (!isNaN(userFractionFloat)) {
|
||||
if (userFractionFloat <= 0.0 || userFractionFloat >= 1.0) {
|
||||
core.setFailed('A provided userFraction must be between 0.0 and 1.0, exclusive-exclusive');
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
userFractionFloat = undefined;
|
||||
}
|
||||
// Insure that the api can find our service account credentials
|
||||
core.exportVariable("GOOGLE_APPLICATION_CREDENTIALS", serviceAccountJson);
|
||||
const authClient = yield auth.getClient();
|
||||
yield edits_1.uploadRelease({
|
||||
auth: authClient,
|
||||
applicationId: packageName,
|
||||
track: track,
|
||||
userFraction: userFractionFloat,
|
||||
whatsNewDir: whatsNewDir,
|
||||
mappingFile: mappingFile
|
||||
}, releaseFile);
|
||||
core.debug('Finished App Release!');
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
|
||||
Reference in New Issue
Block a user