Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6496ac4e3 | ||
|
|
3e0a7f808c | ||
|
|
3fe51cca76 | ||
|
|
50592d62ad | ||
|
|
db7def7467 | ||
|
|
fc9e3b4597 | ||
|
|
c328f3aa5c | ||
|
|
575e057922 |
14
.github/workflows/release.yml
vendored
14
.github/workflows/release.yml
vendored
@@ -11,14 +11,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: Build Action
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
- name: Update v1 Tag
|
- name: Update v1 Tag
|
||||||
run: |
|
uses: hole19/git-tag-action@master
|
||||||
npm prune --production
|
env:
|
||||||
git commit -m "Pruning Node Modules, Preparing for release"
|
TAG: v1
|
||||||
git tag -fa v1 -m "Update v1 tag"
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
git push origin --force --tags
|
|
||||||
|
|||||||
@@ -20,10 +20,13 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
userFraction:
|
userFraction:
|
||||||
description: 'Portion of users who should get the staged version of the app. Accepts values between 0.0 and 1.0 (exclusive-exclusive).'
|
description: 'Portion of users who should get the staged version of the app. Accepts values between 0.0 and 1.0 (exclusive-exclusive).'
|
||||||
|
required: false
|
||||||
whatsNewDirectory:
|
whatsNewDirectory:
|
||||||
description: 'The directory of localized whats new files'
|
description: 'The directory of localized whats new files'
|
||||||
|
required: false
|
||||||
mappingFile:
|
mappingFile:
|
||||||
description: 'The mapping.txt file used to de-obfuscate your stack traces from crash reports'
|
description: 'The mapping.txt file used to de-obfuscate your stack traces from crash reports'
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/main.js'
|
main: 'lib/main.js'
|
||||||
|
|||||||
19
lib/edits.js
19
lib/edits.js
@@ -26,6 +26,11 @@ function uploadRelease(options, releaseFile) {
|
|||||||
auth: options.auth,
|
auth: options.auth,
|
||||||
packageName: options.applicationId
|
packageName: options.applicationId
|
||||||
});
|
});
|
||||||
|
const allTracks = yield getAllTracks(appEdit.data, options);
|
||||||
|
if (allTracks == undefined || allTracks.find(value => value.track == options.track) == undefined) {
|
||||||
|
core.setFailed(`Track "${options.track}" could not be found `);
|
||||||
|
return Promise.reject(`No track found for "${options.track}"`);
|
||||||
|
}
|
||||||
let track = undefined;
|
let track = undefined;
|
||||||
if (releaseFile.endsWith('.apk')) {
|
if (releaseFile.endsWith('.apk')) {
|
||||||
const apk = yield uploadApk(appEdit.data, options, releaseFile);
|
const apk = yield uploadApk(appEdit.data, options, releaseFile);
|
||||||
@@ -51,6 +56,16 @@ function uploadRelease(options, releaseFile) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.uploadRelease = uploadRelease;
|
exports.uploadRelease = uploadRelease;
|
||||||
|
function getAllTracks(appEdit, options) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const res = yield androidPublisher.edits.tracks.list({
|
||||||
|
auth: options.auth,
|
||||||
|
editId: appEdit.id,
|
||||||
|
packageName: options.applicationId
|
||||||
|
});
|
||||||
|
return res.data.tracks;
|
||||||
|
});
|
||||||
|
}
|
||||||
function trackVersionCode(appEdit, options, versionCode) {
|
function trackVersionCode(appEdit, options, versionCode) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
let status;
|
let status;
|
||||||
@@ -85,7 +100,7 @@ function trackVersionCode(appEdit, options, versionCode) {
|
|||||||
}
|
}
|
||||||
function readLocalizedReleaseNotes(whatsNewDir) {
|
function readLocalizedReleaseNotes(whatsNewDir) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (whatsNewDir != undefined) {
|
if (whatsNewDir != undefined && whatsNewDir.length > 0) {
|
||||||
const releaseNotes = fs.readdirSync(whatsNewDir).filter(value => /whatsnew-*-*/.test(value));
|
const releaseNotes = fs.readdirSync(whatsNewDir).filter(value => /whatsnew-*-*/.test(value));
|
||||||
const pattern = /whatsnew-(?<local>.*-.*)/.compile();
|
const pattern = /whatsnew-(?<local>.*-.*)/.compile();
|
||||||
let localizedReleaseNotes = [];
|
let localizedReleaseNotes = [];
|
||||||
@@ -110,7 +125,7 @@ function readLocalizedReleaseNotes(whatsNewDir) {
|
|||||||
}
|
}
|
||||||
function uploadMappingFile(appEdit, versionCode, options) {
|
function uploadMappingFile(appEdit, versionCode, options) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (options.mappingFile != undefined) {
|
if (options.mappingFile != undefined && options.mappingFile.length > 0) {
|
||||||
const mapping = fs_1.readFileSync(options.mappingFile, 'utf-8');
|
const mapping = fs_1.readFileSync(options.mappingFile, 'utf-8');
|
||||||
if (mapping != undefined) {
|
if (mapping != undefined) {
|
||||||
core.debug(`[${appEdit.id}, versionCode=${versionCode}, packageName=${options.applicationId}]: Uploading Proguard mapping file @ ${options.mappingFile}`);
|
core.debug(`[${appEdit.id}, versionCode=${versionCode}, packageName=${options.applicationId}]: Uploading Proguard mapping file @ ${options.mappingFile}`);
|
||||||
|
|||||||
16
lib/main.js
16
lib/main.js
@@ -16,6 +16,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
|
const fs = __importStar(require("fs"));
|
||||||
const edits_1 = require("./edits");
|
const edits_1 = require("./edits");
|
||||||
const { google } = require('googleapis');
|
const { google } = require('googleapis');
|
||||||
const auth = new google.auth.GoogleAuth({
|
const auth = new google.auth.GoogleAuth({
|
||||||
@@ -42,6 +43,19 @@ function run() {
|
|||||||
else {
|
else {
|
||||||
userFractionFloat = undefined;
|
userFractionFloat = undefined;
|
||||||
}
|
}
|
||||||
|
// Check release file
|
||||||
|
if (!fs.existsSync(releaseFile)) {
|
||||||
|
core.setFailed(`Unable to find release file @ ${releaseFile}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (whatsNewDir != undefined && whatsNewDir.length > 0 && !fs.existsSync(whatsNewDir)) {
|
||||||
|
core.setFailed(`Unable to find 'whatsnew' directory @ ${whatsNewDir}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mappingFile != undefined && mappingFile.length > 0 && !fs.existsSync(mappingFile)) {
|
||||||
|
core.setFailed(`Unable to find 'mappingFile' @ ${mappingFile}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Insure that the api can find our service account credentials
|
// Insure that the api can find our service account credentials
|
||||||
core.exportVariable("GOOGLE_APPLICATION_CREDENTIALS", serviceAccountJson);
|
core.exportVariable("GOOGLE_APPLICATION_CREDENTIALS", serviceAccountJson);
|
||||||
const authClient = yield auth.getClient();
|
const authClient = yield auth.getClient();
|
||||||
@@ -53,7 +67,7 @@ function run() {
|
|||||||
whatsNewDir: whatsNewDir,
|
whatsNewDir: whatsNewDir,
|
||||||
mappingFile: mappingFile
|
mappingFile: mappingFile
|
||||||
}, releaseFile);
|
}, releaseFile);
|
||||||
core.debug('Finished App Release!');
|
console.log(`Finished uploading ${releaseFile} to the Play Store`);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
25
node_modules/commander/package.json
generated
vendored
25
node_modules/commander/package.json
generated
vendored
@@ -1,27 +1,34 @@
|
|||||||
{
|
{
|
||||||
"_from": "commander@~2.20.3",
|
"_args": [
|
||||||
|
[
|
||||||
|
"commander@2.20.3",
|
||||||
|
"/Users/drew.heavner/Documents/Github/upload-google-play"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_development": true,
|
||||||
|
"_from": "commander@2.20.3",
|
||||||
"_id": "commander@2.20.3",
|
"_id": "commander@2.20.3",
|
||||||
"_inBundle": false,
|
"_inBundle": false,
|
||||||
"_integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
"_integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||||
"_location": "/commander",
|
"_location": "/commander",
|
||||||
|
"_optional": true,
|
||||||
"_phantomChildren": {},
|
"_phantomChildren": {},
|
||||||
"_requested": {
|
"_requested": {
|
||||||
"type": "range",
|
"type": "version",
|
||||||
"registry": true,
|
"registry": true,
|
||||||
"raw": "commander@~2.20.3",
|
"raw": "commander@2.20.3",
|
||||||
"name": "commander",
|
"name": "commander",
|
||||||
"escapedName": "commander",
|
"escapedName": "commander",
|
||||||
"rawSpec": "~2.20.3",
|
"rawSpec": "2.20.3",
|
||||||
"saveSpec": null,
|
"saveSpec": null,
|
||||||
"fetchSpec": "~2.20.3"
|
"fetchSpec": "2.20.3"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"_requiredBy": [
|
||||||
"/uglify-js"
|
"/uglify-js"
|
||||||
],
|
],
|
||||||
"_resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
"_resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||||
"_shasum": "fd485e84c03eb4881c20722ba48035e8531aeb33",
|
"_spec": "2.20.3",
|
||||||
"_spec": "commander@~2.20.3",
|
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play",
|
||||||
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play/node_modules/uglify-js",
|
|
||||||
"author": {
|
"author": {
|
||||||
"name": "TJ Holowaychuk",
|
"name": "TJ Holowaychuk",
|
||||||
"email": "tj@vision-media.ca"
|
"email": "tj@vision-media.ca"
|
||||||
@@ -29,9 +36,7 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/tj/commander.js/issues"
|
"url": "https://github.com/tj/commander.js/issues"
|
||||||
},
|
},
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"deprecated": false,
|
|
||||||
"description": "the complete solution for node.js command-line programs",
|
"description": "the complete solution for node.js command-line programs",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^12.7.8",
|
"@types/node": "^12.7.8",
|
||||||
|
|||||||
14
node_modules/handlebars/package.json
generated
vendored
14
node_modules/handlebars/package.json
generated
vendored
@@ -1,4 +1,11 @@
|
|||||||
{
|
{
|
||||||
|
"_args": [
|
||||||
|
[
|
||||||
|
"handlebars@4.5.3",
|
||||||
|
"/Users/drew.heavner/Documents/Github/upload-google-play"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_development": true,
|
||||||
"_from": "handlebars@4.5.3",
|
"_from": "handlebars@4.5.3",
|
||||||
"_id": "handlebars@4.5.3",
|
"_id": "handlebars@4.5.3",
|
||||||
"_inBundle": false,
|
"_inBundle": false,
|
||||||
@@ -19,9 +26,8 @@
|
|||||||
"/istanbul-reports"
|
"/istanbul-reports"
|
||||||
],
|
],
|
||||||
"_resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
|
"_resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz",
|
||||||
"_shasum": "5cf75bd8714f7605713511a56be7c349becb0482",
|
"_spec": "4.5.3",
|
||||||
"_spec": "handlebars@4.5.3",
|
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play",
|
||||||
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play/node_modules/istanbul-reports",
|
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Yehuda Katz"
|
"name": "Yehuda Katz"
|
||||||
},
|
},
|
||||||
@@ -36,14 +42,12 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/wycats/handlebars.js/issues"
|
"url": "https://github.com/wycats/handlebars.js/issues"
|
||||||
},
|
},
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"neo-async": "^2.6.0",
|
"neo-async": "^2.6.0",
|
||||||
"optimist": "^0.6.1",
|
"optimist": "^0.6.1",
|
||||||
"source-map": "^0.6.1",
|
"source-map": "^0.6.1",
|
||||||
"uglify-js": "^3.1.4"
|
"uglify-js": "^3.1.4"
|
||||||
},
|
},
|
||||||
"deprecated": false,
|
|
||||||
"description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration",
|
"description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@knappi/grunt-saucelabs": "^9.0.2",
|
"@knappi/grunt-saucelabs": "^9.0.2",
|
||||||
|
|||||||
25
node_modules/uglify-js/package.json
generated
vendored
25
node_modules/uglify-js/package.json
generated
vendored
@@ -1,27 +1,34 @@
|
|||||||
{
|
{
|
||||||
"_from": "uglify-js@^3.1.4",
|
"_args": [
|
||||||
|
[
|
||||||
|
"uglify-js@3.7.1",
|
||||||
|
"/Users/drew.heavner/Documents/Github/upload-google-play"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"_development": true,
|
||||||
|
"_from": "uglify-js@3.7.1",
|
||||||
"_id": "uglify-js@3.7.1",
|
"_id": "uglify-js@3.7.1",
|
||||||
"_inBundle": false,
|
"_inBundle": false,
|
||||||
"_integrity": "sha512-pnOF7jY82wdIhATVn87uUY/FHU+MDUdPLkmGFvGoclQmeu229eTkbG5gjGGBi3R7UuYYSEeYXY/TTY5j2aym2g==",
|
"_integrity": "sha512-pnOF7jY82wdIhATVn87uUY/FHU+MDUdPLkmGFvGoclQmeu229eTkbG5gjGGBi3R7UuYYSEeYXY/TTY5j2aym2g==",
|
||||||
"_location": "/uglify-js",
|
"_location": "/uglify-js",
|
||||||
|
"_optional": true,
|
||||||
"_phantomChildren": {},
|
"_phantomChildren": {},
|
||||||
"_requested": {
|
"_requested": {
|
||||||
"type": "range",
|
"type": "version",
|
||||||
"registry": true,
|
"registry": true,
|
||||||
"raw": "uglify-js@^3.1.4",
|
"raw": "uglify-js@3.7.1",
|
||||||
"name": "uglify-js",
|
"name": "uglify-js",
|
||||||
"escapedName": "uglify-js",
|
"escapedName": "uglify-js",
|
||||||
"rawSpec": "^3.1.4",
|
"rawSpec": "3.7.1",
|
||||||
"saveSpec": null,
|
"saveSpec": null,
|
||||||
"fetchSpec": "^3.1.4"
|
"fetchSpec": "3.7.1"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"_requiredBy": [
|
||||||
"/handlebars"
|
"/handlebars"
|
||||||
],
|
],
|
||||||
"_resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.1.tgz",
|
"_resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.1.tgz",
|
||||||
"_shasum": "35c7de17971a4aa7689cd2eae0a5b39bb838c0c5",
|
"_spec": "3.7.1",
|
||||||
"_spec": "uglify-js@^3.1.4",
|
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play",
|
||||||
"_where": "/Users/drew.heavner/Documents/Github/upload-google-play/node_modules/handlebars",
|
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Mihai Bazon",
|
"name": "Mihai Bazon",
|
||||||
"email": "mihai.bazon@gmail.com",
|
"email": "mihai.bazon@gmail.com",
|
||||||
@@ -33,12 +40,10 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/mishoo/UglifyJS2/issues"
|
"url": "https://github.com/mishoo/UglifyJS2/issues"
|
||||||
},
|
},
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "~2.20.3",
|
"commander": "~2.20.3",
|
||||||
"source-map": "~0.6.1"
|
"source-map": "~0.6.1"
|
||||||
},
|
},
|
||||||
"deprecated": false,
|
|
||||||
"description": "JavaScript parser, mangler/compressor and beautifier toolkit",
|
"description": "JavaScript parser, mangler/compressor and beautifier toolkit",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"acorn": "~7.1.0",
|
"acorn": "~7.1.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "upload-google-play",
|
"name": "upload-google-play",
|
||||||
"version": "1.0.0",
|
"version": "1.0.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Upload an Android release (.apk or .aab) to Google Play Console",
|
"description": "Upload an Android release (.apk or .aab) to Google Play Console",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
|
|||||||
19
src/edits.ts
19
src/edits.ts
@@ -33,6 +33,12 @@ export async function uploadRelease(options: EditOptions, releaseFile: string) {
|
|||||||
packageName: options.applicationId
|
packageName: options.applicationId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const allTracks = await getAllTracks(appEdit.data!, options);
|
||||||
|
if (allTracks == undefined || allTracks.find(value => value.track == options.track) == undefined) {
|
||||||
|
core.setFailed(`Track "${options.track}" could not be found `)
|
||||||
|
return Promise.reject(`No track found for "${options.track}"`)
|
||||||
|
}
|
||||||
|
|
||||||
let track: Track | undefined = undefined;
|
let track: Track | undefined = undefined;
|
||||||
if (releaseFile.endsWith('.apk')) {
|
if (releaseFile.endsWith('.apk')) {
|
||||||
const apk = await uploadApk(appEdit.data, options, releaseFile);
|
const apk = await uploadApk(appEdit.data, options, releaseFile);
|
||||||
@@ -57,6 +63,15 @@ export async function uploadRelease(options: EditOptions, releaseFile: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getAllTracks(appEdit: AppEdit, options: EditOptions): Promise<Track[] | undefined> {
|
||||||
|
const res = await androidPublisher.edits.tracks.list({
|
||||||
|
auth: options.auth,
|
||||||
|
editId: appEdit.id!,
|
||||||
|
packageName: options.applicationId
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data.tracks
|
||||||
|
}
|
||||||
|
|
||||||
async function trackVersionCode(appEdit: AppEdit, options: EditOptions, versionCode: number): Promise<Track> {
|
async function trackVersionCode(appEdit: AppEdit, options: EditOptions, versionCode: number): Promise<Track> {
|
||||||
let status: string;
|
let status: string;
|
||||||
@@ -91,7 +106,7 @@ async function trackVersionCode(appEdit: AppEdit, options: EditOptions, versionC
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function readLocalizedReleaseNotes(whatsNewDir: string | undefined): Promise<LocalizedText[] | undefined> {
|
async function readLocalizedReleaseNotes(whatsNewDir: string | undefined): Promise<LocalizedText[] | undefined> {
|
||||||
if (whatsNewDir != undefined) {
|
if (whatsNewDir != undefined && whatsNewDir.length > 0) {
|
||||||
const releaseNotes = fs.readdirSync(whatsNewDir).filter(value => /whatsnew-*-*/.test(value));
|
const releaseNotes = fs.readdirSync(whatsNewDir).filter(value => /whatsnew-*-*/.test(value));
|
||||||
const pattern = /whatsnew-(?<local>.*-.*)/.compile();
|
const pattern = /whatsnew-(?<local>.*-.*)/.compile();
|
||||||
|
|
||||||
@@ -121,7 +136,7 @@ async function readLocalizedReleaseNotes(whatsNewDir: string | undefined): Promi
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function uploadMappingFile(appEdit: AppEdit, versionCode: number, options: EditOptions) {
|
async function uploadMappingFile(appEdit: AppEdit, versionCode: number, options: EditOptions) {
|
||||||
if (options.mappingFile != undefined) {
|
if (options.mappingFile != undefined && options.mappingFile.length > 0) {
|
||||||
const mapping = readFileSync(options.mappingFile, 'utf-8');
|
const mapping = readFileSync(options.mappingFile, 'utf-8');
|
||||||
if (mapping != undefined) {
|
if (mapping != undefined) {
|
||||||
core.debug(`[${appEdit.id}, versionCode=${versionCode}, packageName=${options.applicationId}]: Uploading Proguard mapping file @ ${options.mappingFile}`);
|
core.debug(`[${appEdit.id}, versionCode=${versionCode}, packageName=${options.applicationId}]: Uploading Proguard mapping file @ ${options.mappingFile}`);
|
||||||
|
|||||||
19
src/main.ts
19
src/main.ts
@@ -1,4 +1,5 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
import * as fs from "fs";
|
||||||
import {uploadRelease} from "./edits";
|
import {uploadRelease} from "./edits";
|
||||||
const {google} = require('googleapis');
|
const {google} = require('googleapis');
|
||||||
|
|
||||||
@@ -27,6 +28,22 @@ async function run() {
|
|||||||
userFractionFloat = undefined
|
userFractionFloat = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check release file
|
||||||
|
if (!fs.existsSync(releaseFile)) {
|
||||||
|
core.setFailed(`Unable to find release file @ ${releaseFile}`);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (whatsNewDir != undefined && whatsNewDir.length > 0 && !fs.existsSync(whatsNewDir)) {
|
||||||
|
core.setFailed(`Unable to find 'whatsnew' directory @ ${whatsNewDir}`);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mappingFile != undefined && mappingFile.length > 0 && !fs.existsSync(mappingFile)) {
|
||||||
|
core.setFailed(`Unable to find 'mappingFile' @ ${mappingFile}`);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Insure that the api can find our service account credentials
|
// Insure that the api can find our service account credentials
|
||||||
core.exportVariable("GOOGLE_APPLICATION_CREDENTIALS", serviceAccountJson);
|
core.exportVariable("GOOGLE_APPLICATION_CREDENTIALS", serviceAccountJson);
|
||||||
|
|
||||||
@@ -41,7 +58,7 @@ async function run() {
|
|||||||
mappingFile: mappingFile
|
mappingFile: mappingFile
|
||||||
}, releaseFile);
|
}, releaseFile);
|
||||||
|
|
||||||
core.debug('Finished App Release!')
|
console.log(`Finished uploading ${releaseFile} to the Play Store`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user