@24i/smartapps-bigscreen-rnv-build-engine 0.8.7-alpha.1414 → 0.8.7-alpha.1415
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.
- package/dist/src/resolvers/resolveBaseUrl.js +1 -1
- package/dist/src/resolvers/resolveBuildFileName.js +2 -2
- package/dist/src/resolvers/resolveBuildVersion.js +2 -2
- package/dist/src/resolvers/resolveBuildVersionOffset.js +2 -2
- package/dist/src/resolvers/resolveDeployLocations.js +5 -5
- package/dist/src/resolvers/resolveGenericRnvConfig.js +2 -2
- package/dist/src/resolvers/resolveHbbtvDeployUrl.js +2 -2
- package/dist/src/resolvers/resolveUsedFlavours.js +1 -1
- package/dist/src/scripts/buildAllWithScheme.js +3 -3
- package/dist/src/scripts/generateDeployUrls/index.js +4 -4
- package/dist/src/scripts/generateDeployUrls/makeTableDataByScheme.js +3 -3
- package/dist/src/scripts/gitReleaser/afterVersionBump.js +6 -6
- package/dist/src/scripts/gitReleaser/beforeVersionBump.js +6 -6
- package/dist/src/scripts/gitReleaser/checkReleaseNotes.js +1 -1
- package/dist/src/scripts/gitReleaser/pushRelease.js +7 -7
- package/dist/src/scripts/gitReleaser/pushReleaseCandidate.js +1 -1
- package/dist/src/scripts/gitReleaser/pushReleaseNotes.js +7 -7
- package/dist/src/scripts/release/deleteSourceMaps.js +1 -1
- package/dist/src/scripts/release/deployToAppCenter.js +6 -6
- package/dist/src/scripts/release/githubRelease.js +16 -16
- package/dist/src/scripts/release/notifySlack/makePayload.js +1 -1
- package/dist/src/scripts/release/notifySlack/notifySlack.js +1 -1
- package/dist/src/scripts/release/sentryRelease.js +3 -3
- package/dist/src/scripts/release/urlsMarkdown.js +1 -1
- package/dist/src/scripts/releaseAllWithScheme.js +11 -11
- package/dist/src/scripts/utils/cmdUtils.js +1 -1
- package/dist/src/scripts/utils/fsUtils.js +1 -1
- package/dist/src/scripts/utils/gitUtils.js +17 -17
- package/dist/src/sdks/sdk-tizen/index.js +9 -9
- package/dist/src/sdks/sdk-webos/index.js +4 -4
- package/dist/src/sdks/sdkUtils.js +1 -1
- package/dist/src/tasks/deploy/aswS3/aws.js +2 -2
- package/dist/src/tasks/deploy/aswS3/deployS3.js +2 -2
- package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +7 -7
- package/dist/src/tasks/task.rnv.build.js +8 -8
- package/dist/src/tasks/task.rnv.configure.js +1 -1
- package/dist/src/tasks/task.rnv.configureSoft.js +2 -2
- package/dist/src/tasks/task.rnv.deploy.js +3 -3
- package/dist/src/tasks/task.rnv.hooks.run.js +1 -1
- package/dist/src/tasks/task.rnv.project.configure.js +2 -2
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +1 -1
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +1 -1
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +1 -1
- package/dist/src/utils/zipBuildsByPlatforms.js +9 -9
- package/dist/templates/platforms/entone/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/entone/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/hbbtv/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/hbbtv/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/saphi/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/saphi/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/tizen/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/tizen/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/webos/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/webos/webpack.config.prod.js +1 -1
- package/dist/templates/platforms/webtv/webpack.config.dev.js +1 -1
- package/dist/templates/platforms/webtv/webpack.config.prod.js +1 -1
- package/package.json +12 -13
|
@@ -4,7 +4,7 @@ exports.resolveBaseUrl = void 0;
|
|
|
4
4
|
const resolveGenericRnvConfig_1 = require("./resolveGenericRnvConfig");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const resolveBaseUrl = ({ platform, scheme, flavour }) => {
|
|
7
|
-
const c =
|
|
7
|
+
const c = resolveGenericRnvConfig_1.getBaseConfig();
|
|
8
8
|
c.platform = platform;
|
|
9
9
|
c.runtime.scheme = scheme;
|
|
10
10
|
c.runtime.appId = flavour;
|
|
@@ -17,7 +17,7 @@ const getBuildVersionForFileName = (c) => {
|
|
|
17
17
|
case constants_1.BuildSchemes.RELEASE_LATEST:
|
|
18
18
|
return 'latest.release';
|
|
19
19
|
default:
|
|
20
|
-
return
|
|
20
|
+
return resolveBuildVersion_1.resolveBuildVersion({
|
|
21
21
|
platform,
|
|
22
22
|
scheme,
|
|
23
23
|
flavour: appId,
|
|
@@ -29,7 +29,7 @@ const resolveBuildFileName = (c) => {
|
|
|
29
29
|
const appNameInFileName = getConfigProp(c, platformName, 'appNameInFileName', '');
|
|
30
30
|
const buildVersion = getBuildVersionForFileName(c);
|
|
31
31
|
const appConfigId = c.runtime.appId || '';
|
|
32
|
-
const extension =
|
|
32
|
+
const extension = resolveBuildFileExtension_1.resolveBuildFileExtension(platformName);
|
|
33
33
|
return `${appNameInFileName}_${platformName}_${buildVersion}_${appConfigId}.${extension}`;
|
|
34
34
|
};
|
|
35
35
|
exports.resolveBuildFileName = resolveBuildFileName;
|
|
@@ -24,13 +24,13 @@ const resolveBuildType = (c) => {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
const resolveVersionOffset = (c) => {
|
|
27
|
-
const versionOffsetString =
|
|
27
|
+
const versionOffsetString = resolveBuildVersionOffset_1.resolveBuildVersionOffset(c);
|
|
28
28
|
return versionOffsetString
|
|
29
29
|
? `-${versionOffsetString}`
|
|
30
30
|
: '';
|
|
31
31
|
};
|
|
32
32
|
const resolveBuildVersion = ({ platform, scheme, flavour }) => {
|
|
33
|
-
const c =
|
|
33
|
+
const c = resolveGenericRnvConfig_1.getBaseConfig();
|
|
34
34
|
c.platform = platform;
|
|
35
35
|
c.runtime.scheme = scheme;
|
|
36
36
|
c.runtime.appId = flavour;
|
|
@@ -6,14 +6,14 @@ const getCurrentGitBranchName = () => {
|
|
|
6
6
|
if (process.env.BRANCH)
|
|
7
7
|
return process.env.BRANCH;
|
|
8
8
|
const gitCommand = 'git branch --show-current';
|
|
9
|
-
return
|
|
9
|
+
return child_process_1.execSync(gitCommand, { stdio: 'pipe' }).toString().trim();
|
|
10
10
|
};
|
|
11
11
|
const getMergedPullRequestsOffsetFromBranch = (branch) => {
|
|
12
12
|
const defaultValue = '';
|
|
13
13
|
const mergeTitleRegex = '^Merge pull request #';
|
|
14
14
|
const cmd = `git rev-list --count --merges --grep="${mergeTitleRegex}" HEAD ^origin/${branch}`;
|
|
15
15
|
try {
|
|
16
|
-
const diffCount =
|
|
16
|
+
const diffCount = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString().trim();
|
|
17
17
|
const diffCountNumeric = parseInt(diffCount, 10);
|
|
18
18
|
return diffCountNumeric > 0 ? String(diffCountNumeric) : defaultValue;
|
|
19
19
|
}
|
|
@@ -10,7 +10,7 @@ const resolveSupportedPlatforms_1 = require("./resolveSupportedPlatforms");
|
|
|
10
10
|
const getBuildVersion = (c) => {
|
|
11
11
|
const { platform, runtime } = c;
|
|
12
12
|
const { scheme, appId } = runtime;
|
|
13
|
-
return
|
|
13
|
+
return resolveBuildVersion_1.resolveBuildVersion({
|
|
14
14
|
platform,
|
|
15
15
|
scheme,
|
|
16
16
|
flavour: appId,
|
|
@@ -30,17 +30,17 @@ const makeOutputObject = (buildVersion = '') => ({
|
|
|
30
30
|
const makeUrls = (c, platformName, flavourName) => {
|
|
31
31
|
const isHbbTVPlatform = platformName === constants_1.Platforms.HBBTV;
|
|
32
32
|
const { scheme } = c.runtime;
|
|
33
|
-
const baseUrl =
|
|
33
|
+
const baseUrl = resolveBaseUrl_1.resolveBaseUrl({
|
|
34
34
|
platform: platformName,
|
|
35
35
|
scheme,
|
|
36
36
|
flavour: flavourName,
|
|
37
37
|
});
|
|
38
38
|
if (!baseUrl)
|
|
39
39
|
return null;
|
|
40
|
-
const packageFileName =
|
|
40
|
+
const packageFileName = resolveBuildFileName_1.resolveBuildFileName(c);
|
|
41
41
|
const packageUrl = packageFileName ? `${baseUrl}/build/${packageFileName}` : '';
|
|
42
42
|
const indexUrl = isHbbTVPlatform
|
|
43
|
-
?
|
|
43
|
+
? resolveHbbtvDeployUrl_1.resolveHbbtvDeployUrl(c, scheme, flavourName)
|
|
44
44
|
: `${baseUrl}/public/index.html`;
|
|
45
45
|
return { packageUrl, indexUrl };
|
|
46
46
|
};
|
|
@@ -73,7 +73,7 @@ const resolveDeployLocations = (c) => {
|
|
|
73
73
|
c.platform = originalPlatform;
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
resolveSupportedPlatforms_1.resolveSupportedPlatforms(c).forEach(processPlatform);
|
|
77
77
|
return output;
|
|
78
78
|
};
|
|
79
79
|
exports.resolveDeployLocations = resolveDeployLocations;
|
|
@@ -28,7 +28,7 @@ const mergeDeep_1 = require("../utils/mergeDeep");
|
|
|
28
28
|
const mergeFileJsonIntoObject = (filePath = '', targetObject = {}) => {
|
|
29
29
|
const fileContentAsString = fs.readFileSync(filePath).toString();
|
|
30
30
|
const fileContentAsJSON = JSON.parse(fileContentAsString);
|
|
31
|
-
|
|
31
|
+
mergeDeep_1.mergeDeep(targetObject, fileContentAsJSON);
|
|
32
32
|
};
|
|
33
33
|
const getBaseConfig = () => {
|
|
34
34
|
const c = rnv_1.ConfigManager.createRnvConfig({ ci: true }, process);
|
|
@@ -38,7 +38,7 @@ const getBaseConfig = () => {
|
|
|
38
38
|
mergeFileJsonIntoObject(c.paths.project.config, c.buildConfig);
|
|
39
39
|
const baseConfigPath = path.join(c.paths.project.appConfigBase.dir, 'renative.json');
|
|
40
40
|
mergeFileJsonIntoObject(baseConfigPath, c.buildConfig);
|
|
41
|
-
|
|
41
|
+
replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig(c);
|
|
42
42
|
return c;
|
|
43
43
|
};
|
|
44
44
|
exports.getBaseConfig = getBaseConfig;
|
|
@@ -4,8 +4,8 @@ exports.resolveHbbtvDeployUrl = void 0;
|
|
|
4
4
|
const resolveHbbtvRemoteBuildDirRelativePath_1 = require("./resolveHbbtvRemoteBuildDirRelativePath");
|
|
5
5
|
const resolveHbbtvDeployConfig_1 = require("./resolveHbbtvDeployConfig");
|
|
6
6
|
const resolveHbbtvDeployUrl = (c, scheme, appConfigId) => {
|
|
7
|
-
const { host } =
|
|
8
|
-
const remoteDirRelativePath =
|
|
7
|
+
const { host } = resolveHbbtvDeployConfig_1.resolveHbbtvDeployConfig();
|
|
8
|
+
const remoteDirRelativePath = resolveHbbtvRemoteBuildDirRelativePath_1.resolveHbbtvRemoteBuildDirRelativePath(c, scheme, appConfigId);
|
|
9
9
|
return `http://${host}/${remoteDirRelativePath}/public/index.html`;
|
|
10
10
|
};
|
|
11
11
|
exports.resolveHbbtvDeployUrl = resolveHbbtvDeployUrl;
|
|
@@ -4,7 +4,7 @@ exports.resolveUsedFlavours = void 0;
|
|
|
4
4
|
const resolveSupportedPlatforms_1 = require("./resolveSupportedPlatforms");
|
|
5
5
|
const resolveUsedFlavours = (rnvC) => {
|
|
6
6
|
const usedFlavours = [];
|
|
7
|
-
const supportedPlatforms =
|
|
7
|
+
const supportedPlatforms = resolveSupportedPlatforms_1.resolveSupportedPlatforms(rnvC);
|
|
8
8
|
for (let i = 0; i < supportedPlatforms.length; i++) {
|
|
9
9
|
const iPlatform = supportedPlatforms[i];
|
|
10
10
|
const iPlatformDeployConfig = rnvC.buildConfig.platforms[iPlatform]?.deploy;
|
|
@@ -6,16 +6,16 @@ const resolvers_1 = require("../resolvers");
|
|
|
6
6
|
const buildTask = (options) => {
|
|
7
7
|
const { scheme, platform, flavour } = options;
|
|
8
8
|
const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci`;
|
|
9
|
-
|
|
9
|
+
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
10
10
|
};
|
|
11
11
|
const buildAllWithScheme = () => {
|
|
12
12
|
const scheme = process.argv[2];
|
|
13
13
|
if (!scheme) {
|
|
14
14
|
throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
|
|
15
15
|
}
|
|
16
|
-
const c =
|
|
16
|
+
const c = resolvers_1.getBaseConfig();
|
|
17
17
|
c.runtime.scheme = scheme;
|
|
18
|
-
|
|
18
|
+
forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, buildTask);
|
|
19
19
|
return true;
|
|
20
20
|
};
|
|
21
21
|
const startTimestamp = Date.now();
|
|
@@ -27,7 +27,7 @@ const fsUtils_1 = require("../utils/fsUtils");
|
|
|
27
27
|
const makeTableDataByScheme_1 = require("./makeTableDataByScheme");
|
|
28
28
|
const formatTableDataSpaces_1 = require("./formatTableDataSpaces");
|
|
29
29
|
const processOutput = (outputFilePath, fileContent) => {
|
|
30
|
-
if (!
|
|
30
|
+
if (!fsUtils_1.isDir(outputFilePath)) {
|
|
31
31
|
const dirname = path.dirname(outputFilePath);
|
|
32
32
|
fs.mkdirSync(dirname, { recursive: true });
|
|
33
33
|
}
|
|
@@ -39,8 +39,8 @@ const tableDataToMarkdown = (tableData) => {
|
|
|
39
39
|
return tableRowsMarkdown.join('\n');
|
|
40
40
|
};
|
|
41
41
|
const makeTableMarkdownByScheme = (rnvC, scheme) => {
|
|
42
|
-
const tableData =
|
|
43
|
-
const formattedTableData =
|
|
42
|
+
const tableData = makeTableDataByScheme_1.makeTableDataByScheme(rnvC, scheme);
|
|
43
|
+
const formattedTableData = formatTableDataSpaces_1.formatTableDataSpaces(tableData);
|
|
44
44
|
return tableDataToMarkdown(formattedTableData);
|
|
45
45
|
};
|
|
46
46
|
const makeMarkdownFileContentRows = (rnvC) => ([
|
|
@@ -81,7 +81,7 @@ const main = () => {
|
|
|
81
81
|
if (!outputFilePath) {
|
|
82
82
|
throw new Error('You need to provide a path to output file as an argument!');
|
|
83
83
|
}
|
|
84
|
-
const rnvC =
|
|
84
|
+
const rnvC = resolvers_1.getBaseConfig();
|
|
85
85
|
const markdownFileContentRows = makeMarkdownFileContentRows(rnvC);
|
|
86
86
|
processOutput(outputFilePath, markdownFileContentRows.join('\n'));
|
|
87
87
|
};
|
|
@@ -28,8 +28,8 @@ const makePlatformRowData = (rnvC, deployLocations, tableFlavours, platform) =>
|
|
|
28
28
|
return data;
|
|
29
29
|
};
|
|
30
30
|
const makeTablePlatformsData = (rnvC, usedFlavours) => {
|
|
31
|
-
const supportedPlatforms =
|
|
32
|
-
const deployLocations =
|
|
31
|
+
const supportedPlatforms = resolvers_1.resolveSupportedPlatforms(rnvC);
|
|
32
|
+
const deployLocations = resolvers_1.resolveDeployLocations(rnvC);
|
|
33
33
|
const data = [];
|
|
34
34
|
for (let i = 0; i < supportedPlatforms.length; i++) {
|
|
35
35
|
const platform = supportedPlatforms[i];
|
|
@@ -52,7 +52,7 @@ const makeTableDataByScheme = (rnvC, scheme) => {
|
|
|
52
52
|
const originalScheme = rnvC.runtime.scheme;
|
|
53
53
|
const tableData = [];
|
|
54
54
|
rnvC.runtime.scheme = scheme;
|
|
55
|
-
const usedFlavours =
|
|
55
|
+
const usedFlavours = resolvers_1.resolveUsedFlavours(rnvC);
|
|
56
56
|
const headerData = makeHeaderData(usedFlavours);
|
|
57
57
|
tableData.push(...headerData);
|
|
58
58
|
const tablePlatformsData = makeTablePlatformsData(rnvC, usedFlavours);
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const resolvers_1 = require("../../resolvers");
|
|
4
4
|
const gitUtils_1 = require("../utils/gitUtils");
|
|
5
|
-
const c =
|
|
5
|
+
const c = resolvers_1.getBaseConfig();
|
|
6
6
|
const { branchNames, commitTitles } = c.buildConfig.common.git;
|
|
7
7
|
const { packageVersion = '' } = c.buildConfig.common;
|
|
8
8
|
const newReleaseBranchName = branchNames.rc;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
gitUtils_1.createBranch(newReleaseBranchName);
|
|
10
|
+
gitUtils_1.checkout(newReleaseBranchName);
|
|
11
|
+
gitUtils_1.addAll();
|
|
12
12
|
const withNoVerifyFlag = true;
|
|
13
13
|
console.log('Creating commit with changed version...');
|
|
14
|
-
|
|
14
|
+
gitUtils_1.commit(commitTitles.versionBump, withNoVerifyFlag);
|
|
15
15
|
console.log(`Pushing ${newReleaseBranchName} branch...`);
|
|
16
|
-
|
|
16
|
+
gitUtils_1.push(newReleaseBranchName, withNoVerifyFlag);
|
|
17
17
|
console.log(`\nDone! The version has been bumped to ${packageVersion} and ${newReleaseBranchName} branch pushed into the remote repository.`);
|
|
18
18
|
console.log('Note: Do not forget to update release notes for upcoming release!');
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const assert_1 = require("assert");
|
|
4
4
|
const resolvers_1 = require("../../resolvers");
|
|
5
5
|
const gitUtils_1 = require("../utils/gitUtils");
|
|
6
|
-
const c =
|
|
6
|
+
const c = resolvers_1.getBaseConfig();
|
|
7
7
|
const { branchNames, commitTitles } = c.buildConfig.common.git;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
assert_1.ok(branchNames.dev);
|
|
9
|
+
assert_1.ok(branchNames.rc);
|
|
10
|
+
assert_1.ok(commitTitles.versionBump);
|
|
11
|
+
gitUtils_1.assertCurrentBranch(branchNames.dev);
|
|
12
|
+
gitUtils_1.assertEmptyStatusList();
|
|
@@ -9,7 +9,7 @@ const checkReleaseNotes = (c) => {
|
|
|
9
9
|
const fileContent = utils_1.fsUtils.getFileContentAsString(relativePath);
|
|
10
10
|
const assertFileContentRow = (expectedRowContent) => {
|
|
11
11
|
const errorMsg = `${relativePath} should contain following row: "${expectedRowContent}"`;
|
|
12
|
-
|
|
12
|
+
assert_1.ok(fileContent.includes(expectedRowContent), errorMsg);
|
|
13
13
|
};
|
|
14
14
|
requiredRows.forEach(assertFileContentRow);
|
|
15
15
|
};
|
|
@@ -4,24 +4,24 @@ const assert_1 = require("assert");
|
|
|
4
4
|
const resolvers_1 = require("../../resolvers");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const checkReleaseNotes_1 = require("./checkReleaseNotes");
|
|
7
|
-
const c =
|
|
7
|
+
const c = resolvers_1.getBaseConfig();
|
|
8
8
|
const { branchNames, pullRequestTitles } = c.buildConfig.common.git || {};
|
|
9
9
|
const rcBranchName = branchNames.rc;
|
|
10
10
|
const distBranchName = branchNames.dist;
|
|
11
11
|
const devBranchName = branchNames.dev;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
assert_1.ok(rcBranchName);
|
|
13
|
+
assert_1.ok(distBranchName);
|
|
14
|
+
assert_1.ok(devBranchName);
|
|
15
15
|
utils_1.gitUtils.assertCurrentBranch(rcBranchName);
|
|
16
16
|
utils_1.gitUtils.assertEmptyStatusList();
|
|
17
17
|
utils_1.gitUtils.assertRemoteBranch(rcBranchName);
|
|
18
18
|
utils_1.gitUtils.assertRemoteBranch(distBranchName);
|
|
19
19
|
const distributionPrTitle = pullRequestTitles.rcToDist;
|
|
20
20
|
const developmentPrTitle = pullRequestTitles.rcToDev;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
assert_1.ok(distributionPrTitle);
|
|
22
|
+
assert_1.ok(developmentPrTitle);
|
|
23
23
|
utils_1.gitUtils.pull();
|
|
24
|
-
|
|
24
|
+
checkReleaseNotes_1.checkReleaseNotes(c);
|
|
25
25
|
console.log(`Creating Pull Request from ${rcBranchName} branch to ${distBranchName} branch...`);
|
|
26
26
|
console.log(`Applied PR title: "${distributionPrTitle}"`);
|
|
27
27
|
utils_1.gitUtils.pullRequest(rcBranchName, distBranchName, distributionPrTitle);
|
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const child_process_1 = require("child_process");
|
|
4
4
|
console.log('Bumping the version...');
|
|
5
5
|
const bumpType = process.argv[2] || 'patch';
|
|
6
|
-
|
|
6
|
+
child_process_1.execSync(`npm --no-git-tag-version version ${bumpType}`, { stdio: 'inherit' });
|
|
@@ -4,20 +4,20 @@ const assert_1 = require("assert");
|
|
|
4
4
|
const resolvers_1 = require("../../resolvers");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const checkReleaseNotes_1 = require("./checkReleaseNotes");
|
|
7
|
-
const c =
|
|
7
|
+
const c = resolvers_1.getBaseConfig();
|
|
8
8
|
const { branchNames, commitTitles, pullRequestTitles } = c.buildConfig.common.git || {};
|
|
9
9
|
const { relativePath } = c.buildConfig.common.releaseNotes || {};
|
|
10
10
|
const rcBranchName = branchNames.rc;
|
|
11
11
|
const releaseNotesBranchName = branchNames.rcReleaseNotes;
|
|
12
12
|
const commitTitle = commitTitles.rcReleaseNotes;
|
|
13
13
|
const prTitle = pullRequestTitles.releaseNotesToRc;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
assert_1.ok(relativePath);
|
|
15
|
+
assert_1.ok(releaseNotesBranchName);
|
|
16
|
+
assert_1.ok(commitTitle);
|
|
17
|
+
assert_1.ok(prTitle);
|
|
18
18
|
utils_1.gitUtils.assertCurrentBranch(rcBranchName);
|
|
19
19
|
utils_1.gitUtils.assertRemoteBranch(rcBranchName);
|
|
20
|
-
|
|
20
|
+
checkReleaseNotes_1.checkReleaseNotes(c);
|
|
21
21
|
utils_1.gitUtils.pull();
|
|
22
22
|
const changedFilesCount = utils_1.gitUtils.statusList().length;
|
|
23
23
|
if (changedFilesCount === 0) {
|
|
@@ -25,7 +25,7 @@ if (changedFilesCount === 0) {
|
|
|
25
25
|
console.log('Skipping making a commit, if needed, please continue on your own (manually).');
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
|
|
28
|
+
assert_1.ok(changedFilesCount === 1, `Only ${relativePath} should contain changes!`);
|
|
29
29
|
utils_1.gitUtils.createBranch(releaseNotesBranchName);
|
|
30
30
|
utils_1.gitUtils.checkout(releaseNotesBranchName);
|
|
31
31
|
utils_1.gitUtils.add([relativePath]);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteSourceMaps = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
|
-
const executeSync = (cmd) =>
|
|
5
|
+
const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
6
6
|
const deleteSourceMaps = (c) => {
|
|
7
7
|
const { platformBuildsDir } = c.buildConfig.paths;
|
|
8
8
|
executeSync(`find ${platformBuildsDir} -type f -iname "*.map" -delete`);
|
|
@@ -28,7 +28,7 @@ const urlsMarkdown_1 = require("./urlsMarkdown");
|
|
|
28
28
|
const appCenterRelease = (params) => {
|
|
29
29
|
const { filePath, releaseNotesPath, buildVersion, token, projectName } = params;
|
|
30
30
|
const app = `24i-Media/${projectName}`;
|
|
31
|
-
|
|
31
|
+
child_process_1.execSync('appcenter distribute release '
|
|
32
32
|
+ `--file "${filePath}" `
|
|
33
33
|
+ `--release-notes-file "${releaseNotesPath}" `
|
|
34
34
|
+ `--build-version "${buildVersion}" `
|
|
@@ -56,7 +56,7 @@ const processPlatform = (c, platformName) => {
|
|
|
56
56
|
return;
|
|
57
57
|
const { appName } = appCenterConfig;
|
|
58
58
|
const token = getTokenByPlatform(platformName);
|
|
59
|
-
const zipPath =
|
|
59
|
+
const zipPath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
|
|
60
60
|
const buildVersion = getConfigProp(c, platformName, 'packageVersion', '');
|
|
61
61
|
const releaseNotesPath = getConfigProp(c, platformName, 'releaseNotes', {}).relativePath || '';
|
|
62
62
|
if (!appName || !token || !releaseNotesPath || !zipPath || !buildVersion)
|
|
@@ -65,9 +65,9 @@ const processPlatform = (c, platformName) => {
|
|
|
65
65
|
if (fs.existsSync(tempReleaseNotesPath)) {
|
|
66
66
|
fs.unlinkSync(tempReleaseNotesPath);
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
const urlsMarkdown =
|
|
70
|
-
|
|
68
|
+
child_process_1.execSync(`cat ${releaseNotesPath} >> ${tempReleaseNotesPath}`);
|
|
69
|
+
const urlsMarkdown = urlsMarkdown_1.getUrlsMarkdown(c, [platformName]);
|
|
70
|
+
child_process_1.execSync(`echo "${urlsMarkdown}" >> ${tempReleaseNotesPath}`);
|
|
71
71
|
console.log(`Deploying ${platformName} platform to AppCenter.ms...`);
|
|
72
72
|
appCenterRelease({
|
|
73
73
|
projectName: appName,
|
|
@@ -78,6 +78,6 @@ const processPlatform = (c, platformName) => {
|
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
80
|
const deployToAppCenter = (c) => {
|
|
81
|
-
|
|
81
|
+
resolvers_1.resolveSupportedPlatforms(c).forEach((platformName) => processPlatform(c, platformName));
|
|
82
82
|
};
|
|
83
83
|
exports.deployToAppCenter = deployToAppCenter;
|
|
@@ -58,20 +58,20 @@ const deleteFileIfExists = (filePath) => {
|
|
|
58
58
|
};
|
|
59
59
|
const makeGitHubReleaseNotes = (c) => {
|
|
60
60
|
const releaseNotesPath = getReleaseNotesPath(c);
|
|
61
|
-
|
|
61
|
+
assert_1.ok(releaseNotesPath, 'The path to the file with release notes is missing!');
|
|
62
62
|
deleteFileIfExists(githubReleaseNotesPath);
|
|
63
|
-
|
|
64
|
-
const textToAppend =
|
|
65
|
-
|
|
63
|
+
child_process_1.execSync(`sed '1d;2d' ${releaseNotesPath} >> ${githubReleaseNotesPath}`);
|
|
64
|
+
const textToAppend = urlsMarkdown_1.getUrlsMarkdown(c);
|
|
65
|
+
child_process_1.execSync(`echo "${textToAppend}" >> ${githubReleaseNotesPath}`);
|
|
66
66
|
};
|
|
67
67
|
const createRelease = (c) => {
|
|
68
68
|
const { packageVersion, git } = c.buildConfig.common;
|
|
69
69
|
const versionLabel = `v${packageVersion}`;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
assert_1.ok(token, 'process.env.GITHUB_TOKEN is not set!');
|
|
71
|
+
assert_1.ok(targetCommit, 'process.env.TRAVIS_COMMIT is not set!');
|
|
72
|
+
assert_1.ok(git.owner, 'Missing value for rnv config prop: common.git.owner');
|
|
73
|
+
assert_1.ok(git.repo, 'Missing value for rnv config prop: common.git.repo');
|
|
74
|
+
assert_1.ok(packageVersion);
|
|
75
75
|
makeGitHubReleaseNotes(c);
|
|
76
76
|
const releaseNotesContent = fs.readFileSync(githubReleaseNotesPath).toString();
|
|
77
77
|
const data = {
|
|
@@ -87,7 +87,7 @@ const createRelease = (c) => {
|
|
|
87
87
|
const dataStringWithFixedSingleQuotes = JSON.stringify(data).replace(/'/g, "'\\''");
|
|
88
88
|
const cmd = `curl -X POST ${headers} ${url} -d '${dataStringWithFixedSingleQuotes}'`;
|
|
89
89
|
console.log(`Pushing GitHub Release: ${versionLabel}...`);
|
|
90
|
-
const responseString =
|
|
90
|
+
const responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
|
|
91
91
|
const response = JSON.parse(responseString);
|
|
92
92
|
handleResponseErrors(response);
|
|
93
93
|
console.log('Pushing done.');
|
|
@@ -95,23 +95,23 @@ const createRelease = (c) => {
|
|
|
95
95
|
};
|
|
96
96
|
const getFileMimeType = (filepath) => {
|
|
97
97
|
const cmd = `file --mime-type -b ${filepath}`;
|
|
98
|
-
return
|
|
98
|
+
return child_process_1.execSync(cmd, { stdio: 'pipe' })
|
|
99
99
|
.toString()
|
|
100
100
|
.replace(/\r?\n/, '');
|
|
101
101
|
};
|
|
102
102
|
const uploadAsset = (uploadUrl, filePath) => {
|
|
103
103
|
const url = `${uploadUrl.replace('{?name,label}', '')}`;
|
|
104
104
|
const headers = `-H "Accept: ${githubContentType}" -H "Authorization: token ${token}" -H "content-type: ${getFileMimeType(filePath)}" -H "content-length: ${fs.statSync(filePath).size}"`;
|
|
105
|
-
const cmd = `curl --data-binary @"${filePath}" ${headers} ${url}?name=${
|
|
105
|
+
const cmd = `curl --data-binary @"${filePath}" ${headers} ${url}?name=${path_1.basename(filePath)}`;
|
|
106
106
|
console.log(`Uploading ${filePath} asset to created GitHub Release...`);
|
|
107
|
-
const responseString =
|
|
107
|
+
const responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
|
|
108
108
|
const uploadResponse = JSON.parse(responseString);
|
|
109
109
|
handleResponseErrors(uploadResponse);
|
|
110
110
|
console.log('Uploading done.');
|
|
111
111
|
return uploadResponse;
|
|
112
112
|
};
|
|
113
113
|
const uploadZipWithPlatformBuilds = (c, platformName, githubUploadUrl) => {
|
|
114
|
-
const zipFilePath =
|
|
114
|
+
const zipFilePath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
|
|
115
115
|
if (zipFilePath) {
|
|
116
116
|
uploadAsset(githubUploadUrl, zipFilePath);
|
|
117
117
|
}
|
|
@@ -119,8 +119,8 @@ const uploadZipWithPlatformBuilds = (c, platformName, githubUploadUrl) => {
|
|
|
119
119
|
const githubRelease = (c) => {
|
|
120
120
|
const releaseResponse = createRelease(c) || {};
|
|
121
121
|
const uploadUrl = releaseResponse.upload_url;
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
assert_1.ok(uploadUrl, 'Missing "upload_url" in release response!');
|
|
123
|
+
resolvers_1.resolveSupportedPlatforms(c).forEach((platformName) => {
|
|
124
124
|
uploadZipWithPlatformBuilds(c, platformName, uploadUrl);
|
|
125
125
|
});
|
|
126
126
|
deleteFileIfExists(githubReleaseNotesPath);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.makeDistributionPayload = exports.makeReleaseCandidatePayload = exports.makeDevelopmentPayload = void 0;
|
|
4
4
|
const slackBlockKitBuilder_1 = require("./slackBlockKitBuilder");
|
|
5
5
|
const resolvers_1 = require("../../../resolvers");
|
|
6
|
-
const getVersionsObject = (c) =>
|
|
6
|
+
const getVersionsObject = (c) => resolvers_1.resolveDeployLocations(c).versions;
|
|
7
7
|
const getVersion = (c) => Object.keys(getVersionsObject(c))[0] || '';
|
|
8
8
|
const getPlatformsObject = (c) => {
|
|
9
9
|
const version = getVersion(c);
|
|
@@ -38,7 +38,7 @@ const notifySlack = (c) => {
|
|
|
38
38
|
const webHookUrl = c.buildConfig.common.deploy.slack?.webhookUrl || '';
|
|
39
39
|
if (webHookUrl) {
|
|
40
40
|
const cmd = `curl -X POST -H ${contentType} ${data} ${webHookUrl}`;
|
|
41
|
-
|
|
41
|
+
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
exports.notifySlack = notifySlack;
|
|
@@ -25,7 +25,7 @@ const fs = __importStar(require("fs"));
|
|
|
25
25
|
const constants_1 = require("../../constants");
|
|
26
26
|
const resolvers_1 = require("../../resolvers");
|
|
27
27
|
const UNSUPPORTED_PLATFORMS = [constants_1.Platforms.WEBTV];
|
|
28
|
-
const executeSync = (cmd) =>
|
|
28
|
+
const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
29
29
|
const createNewRelease = (version) => {
|
|
30
30
|
executeSync(`sentry-cli releases new ${version}`);
|
|
31
31
|
};
|
|
@@ -62,7 +62,7 @@ const processPlatform = (c, platform, version) => {
|
|
|
62
62
|
supportedFlavours.forEach(processFlavour);
|
|
63
63
|
};
|
|
64
64
|
const isSentryProjectConfigured = () => {
|
|
65
|
-
const cmd =
|
|
65
|
+
const cmd = child_process_1.execSync('sentry-cli info --config-status-json');
|
|
66
66
|
const sentryConfig = JSON.parse(cmd.toString()) || {};
|
|
67
67
|
return !!sentryConfig.config?.project;
|
|
68
68
|
};
|
|
@@ -74,7 +74,7 @@ const sentryRelease = (c) => {
|
|
|
74
74
|
const version = `v${c.buildConfig.common?.packageVersion}`;
|
|
75
75
|
if (!version)
|
|
76
76
|
return;
|
|
77
|
-
const supportedPlatforms =
|
|
77
|
+
const supportedPlatforms = resolvers_1.resolveSupportedPlatforms(c);
|
|
78
78
|
const supportedPlatformsBySentry = supportedPlatforms.filter((platform) => !UNSUPPORTED_PLATFORMS.includes(platform));
|
|
79
79
|
createNewRelease(version);
|
|
80
80
|
supportedPlatformsBySentry.forEach((platform) => processPlatform(c, platform, version));
|
|
@@ -5,7 +5,7 @@ const constants_1 = require("../../constants");
|
|
|
5
5
|
const resolvers_1 = require("../../resolvers");
|
|
6
6
|
const newLine = '\r\n';
|
|
7
7
|
const getDataToProceed = (c, customPlatformList = []) => {
|
|
8
|
-
const locations =
|
|
8
|
+
const locations = resolvers_1.resolveDeployLocations(c);
|
|
9
9
|
const { versions } = locations;
|
|
10
10
|
const { platforms } = versions[Object.keys(versions)[0]];
|
|
11
11
|
if (!customPlatformList.length)
|
|
@@ -13,11 +13,11 @@ const constants_1 = require("../constants");
|
|
|
13
13
|
const deployTask = (options) => {
|
|
14
14
|
const { scheme, platform, flavour } = options;
|
|
15
15
|
const cmd = `npx rnv deploy -s ${scheme} -p ${platform} -c ${flavour} --ci --only`;
|
|
16
|
-
|
|
16
|
+
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
17
17
|
};
|
|
18
18
|
const deployBuilds = (c) => {
|
|
19
19
|
console.log('Deploying the builds...');
|
|
20
|
-
|
|
20
|
+
forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, deployTask);
|
|
21
21
|
return true;
|
|
22
22
|
};
|
|
23
23
|
const doLatestDevelopmentRelease = (c) => {
|
|
@@ -27,7 +27,7 @@ const doLatestDevelopmentRelease = (c) => {
|
|
|
27
27
|
const doLatestReleaseCandidateRelease = (c) => {
|
|
28
28
|
console.log('doLatestReleaseCandidateRelease');
|
|
29
29
|
deployBuilds(c);
|
|
30
|
-
|
|
30
|
+
notifySlack_1.notifySlack(c);
|
|
31
31
|
return true;
|
|
32
32
|
};
|
|
33
33
|
const doLatestRelease = (c) => {
|
|
@@ -36,13 +36,13 @@ const doLatestRelease = (c) => {
|
|
|
36
36
|
};
|
|
37
37
|
const doDistributionRelease = (c) => {
|
|
38
38
|
console.log('doDistributionRelease');
|
|
39
|
-
|
|
39
|
+
zipBuildsByPlatforms_1.zipBuildsByPlatforms(c);
|
|
40
40
|
deployBuilds(c);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
sentryRelease_1.sentryRelease(c);
|
|
42
|
+
deleteSourceMaps_1.deleteSourceMaps(c);
|
|
43
|
+
githubRelease_1.githubRelease(c);
|
|
44
|
+
deployToAppCenter_1.deployToAppCenter(c);
|
|
45
|
+
notifySlack_1.notifySlack(c);
|
|
46
46
|
return true;
|
|
47
47
|
};
|
|
48
48
|
const releaseAllWithScheme = () => {
|
|
@@ -50,7 +50,7 @@ const releaseAllWithScheme = () => {
|
|
|
50
50
|
if (!scheme) {
|
|
51
51
|
throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
|
|
52
52
|
}
|
|
53
|
-
const c =
|
|
53
|
+
const c = resolvers_1.getBaseConfig();
|
|
54
54
|
c.runtime.scheme = scheme;
|
|
55
55
|
switch (scheme) {
|
|
56
56
|
case constants_1.BuildSchemes.DEV_LATEST:
|
|
@@ -69,7 +69,7 @@ const releaseAllWithScheme = () => {
|
|
|
69
69
|
throw new Error('Unsupported scheme to release!');
|
|
70
70
|
}
|
|
71
71
|
const spacing = 4;
|
|
72
|
-
console.log(JSON.stringify(
|
|
72
|
+
console.log(JSON.stringify(resolvers_1.resolveDeployLocations(c), null, spacing));
|
|
73
73
|
return true;
|
|
74
74
|
};
|
|
75
75
|
const startTimestamp = Date.now();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cmdSyncTrimOut = exports.cmdSyncPipeOut = exports.cmdSyncInheritOut = exports.cmdSync = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
|
-
const cmdSync = (command, options) =>
|
|
5
|
+
const cmdSync = (command, options) => child_process_1.execSync(command, options);
|
|
6
6
|
exports.cmdSync = cmdSync;
|
|
7
7
|
const cmdSyncInheritOut = (command) => cmdSync(command, { stdio: 'inherit' });
|
|
8
8
|
exports.cmdSyncInheritOut = cmdSyncInheritOut;
|
|
@@ -26,7 +26,7 @@ const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString(
|
|
|
26
26
|
exports.getFileContentAsString = getFileContentAsString;
|
|
27
27
|
const assertPath = (path) => {
|
|
28
28
|
const errorMsg = `File or path ${path} does not exist!`;
|
|
29
|
-
|
|
29
|
+
assert_1.ok(fs.existsSync(path), errorMsg);
|
|
30
30
|
};
|
|
31
31
|
exports.assertPath = assertPath;
|
|
32
32
|
const isDir = (verifiedPath) => (fs.existsSync(verifiedPath) && fs.lstatSync(verifiedPath).isDirectory());
|