@24i/smartapps-bigscreen-rnv-build-engine 0.17.6-alpha.11 → 0.17.6-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -27,10 +27,9 @@ exports.getProductionZipFileRelativePath = void 0;
|
|
|
27
27
|
const path = __importStar(require("path"));
|
|
28
28
|
const getProductionZipFileRelativePath = (c) => {
|
|
29
29
|
const { appNameInFileName } = c.buildConfig.common;
|
|
30
|
-
const buildVersion = c.buildConfig.common.packageVersion;
|
|
31
30
|
const { platformBuildsDir } = c.buildConfig.paths;
|
|
32
31
|
const platformBuildsDirPath = path.join(platformBuildsDir);
|
|
33
|
-
const zipFileName = `${appNameInFileName}.
|
|
32
|
+
const zipFileName = `${appNameInFileName}.production_packages.zip`;
|
|
34
33
|
return path.join(platformBuildsDirPath, zipFileName);
|
|
35
34
|
};
|
|
36
35
|
exports.getProductionZipFileRelativePath = getProductionZipFileRelativePath;
|
|
@@ -25,12 +25,23 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.deployProductionPackagesToAppCenter = void 0;
|
|
27
27
|
const child_process_1 = require("child_process");
|
|
28
|
+
const path = __importStar(require("path"));
|
|
28
29
|
const fs = __importStar(require("fs"));
|
|
29
30
|
const constants_1 = require("../../../constants");
|
|
30
31
|
const buildProductionPackages_1 = require("../../../constants/buildProductionPackages");
|
|
31
32
|
const resolvers_1 = require("../../../resolvers");
|
|
32
33
|
const appCenter_1 = require("./appCenter");
|
|
34
|
+
const ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES = 'APPCENTER_TOKEN_PRODUCTION_PACKAGES';
|
|
33
35
|
const newLine = '\r\n';
|
|
36
|
+
const formatDateTime = (date) => {
|
|
37
|
+
const year = date.getFullYear();
|
|
38
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
39
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
40
|
+
const h = String(date.getHours()).padStart(2, '0');
|
|
41
|
+
const m = String(date.getMinutes()).padStart(2, '0');
|
|
42
|
+
const s = String(date.getSeconds()).padStart(2, '0');
|
|
43
|
+
return `${year}-${month}-${day}T${h}-${m}-${s}`;
|
|
44
|
+
};
|
|
34
45
|
const getAppCenterConfig = (c) => {
|
|
35
46
|
try {
|
|
36
47
|
return c.buildConfig.common.deploy?.productionPackages?.appCenter || null;
|
|
@@ -64,7 +75,7 @@ const getPlatformPackagesList = (c) => {
|
|
|
64
75
|
return packagesList;
|
|
65
76
|
};
|
|
66
77
|
const getAppCenterToken = () => {
|
|
67
|
-
return process.env[
|
|
78
|
+
return process.env[ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES] || '';
|
|
68
79
|
};
|
|
69
80
|
const deployProductionPackagesToAppCenter = (c) => {
|
|
70
81
|
console.log('deployProductionPackagesToAppCenter');
|
|
@@ -74,16 +85,15 @@ const deployProductionPackagesToAppCenter = (c) => {
|
|
|
74
85
|
}
|
|
75
86
|
const { appName: centerAppName } = appCenterConfig;
|
|
76
87
|
const token = getAppCenterToken();
|
|
77
|
-
const
|
|
78
|
-
const { appName, packageVersion } = c.buildConfig.common;
|
|
88
|
+
const { appName } = c.buildConfig.common;
|
|
79
89
|
if (!centerAppName)
|
|
80
|
-
throw new Error('Missing
|
|
90
|
+
throw new Error('Missing AppName in appCenterConfig');
|
|
81
91
|
if (!token)
|
|
82
|
-
throw new Error(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
throw new Error(`Missing App Center Token. To fix it, set "${ENV_APPCENTER_TOKEN_PRODUCTION_PACKAGES}" env variable`);
|
|
93
|
+
const originalZipPath = (0, resolvers_1.getProductionZipFileRelativePath)(c);
|
|
94
|
+
const { dir, name } = path.parse(originalZipPath);
|
|
95
|
+
const zipPath = path.join(dir, `${name}_${formatDateTime(new Date())}.zip`);
|
|
96
|
+
fs.renameSync(originalZipPath, zipPath);
|
|
87
97
|
const tempReleaseNotesPath = `RELEASE_NOTES_APPCENTER_PRODUCTION_PACKAGES.md`;
|
|
88
98
|
if (fs.existsSync(tempReleaseNotesPath)) {
|
|
89
99
|
fs.unlinkSync(tempReleaseNotesPath);
|
|
@@ -108,7 +118,7 @@ const deployProductionPackagesToAppCenter = (c) => {
|
|
|
108
118
|
console.log(`Deploying Production packages to AppCenter.ms...`);
|
|
109
119
|
(0, appCenter_1.appCenterRelease)({
|
|
110
120
|
projectName: centerAppName,
|
|
111
|
-
buildVersion:
|
|
121
|
+
buildVersion: '0',
|
|
112
122
|
filePath: zipPath,
|
|
113
123
|
releaseNotesPath: tempReleaseNotesPath,
|
|
114
124
|
token,
|
|
@@ -42,8 +42,8 @@ const getPlatformBuildsPaths = (c, platformName, scheme) => {
|
|
|
42
42
|
const platformBuildsGlob = `${outputGlob}/*.${(0, index_1.resolveBuildFileExtension)(platformName)}`;
|
|
43
43
|
try {
|
|
44
44
|
const buildsPathsCandidates = glob.sync(platformBuildsGlob) || [];
|
|
45
|
-
const
|
|
46
|
-
return
|
|
45
|
+
const platformBuildsPaths = buildsPathsCandidates.filter((path) => path.includes(platformName));
|
|
46
|
+
return platformBuildsPaths;
|
|
47
47
|
}
|
|
48
48
|
catch (e) {
|
|
49
49
|
return [];
|
|
@@ -104,7 +104,7 @@ const processPlatform = (c, platformName, schemes) => {
|
|
|
104
104
|
(0, fs_1.rmdirSync)(tempPlatformDir, { recursive: true });
|
|
105
105
|
};
|
|
106
106
|
const zipStagingProdBuildsByPlatforms = (c, schemes) => {
|
|
107
|
-
const [
|
|
107
|
+
const [, prodScheme] = schemes;
|
|
108
108
|
if (!prodScheme) {
|
|
109
109
|
throw new Error('Missing production scheme.');
|
|
110
110
|
}
|
package/package.json
CHANGED