Finished action

Adding the monolith node_modules dir for deployment
This commit is contained in:
Drew Heavner
2019-12-04 09:58:34 -05:00
parent d665ce5758
commit a29f8cd536
8629 changed files with 2587149 additions and 190 deletions

View File

@@ -1,19 +1,50 @@
import * as core from '@actions/core';
import {wait} from './wait'
import {uploadRelease} from "./edits";
const {google} = require('googleapis');
const auth = new google.auth.GoogleAuth({
scopes: ['https://www.googleapis.com/auth/androidpublisher']
});
async function run() {
try {
const ms = core.getInput('milliseconds');
console.log(`Waiting ${ms} milliseconds ...`)
try {
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 });
core.debug((new Date()).toTimeString())
await wait(parseInt(ms, 10));
core.debug((new Date()).toTimeString())
// verify inputs
let userFractionFloat: number | undefined = 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
}
core.setOutput('time', new Date().toTimeString());
} catch (error) {
core.setFailed(error.message);
}
// Insure that the api can find our service account credentials
core.exportVariable("GOOGLE_APPLICATION_CREDENTIALS", serviceAccountJson);
const authClient = await auth.getClient();
await 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)
}
}
run();