Skip to content

Commit

Permalink
Game templates in changelog (#6458)
Browse files Browse the repository at this point in the history
Do not show in changelog
  • Loading branch information
ClementPasteau committed Mar 14, 2024
1 parent d4cdb3f commit 7c0a7a4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions newIDE/app/scripts/extract-changelog.js
Expand Up @@ -61,6 +61,13 @@ if (!args['examplesGitPath']) {
}
const examplesGitPath = args['examplesGitPath'];

if (!args['templatesGitPath']) {
shell.echo(
'⚠️ You should pass --templatesGitPath pointing to the git directory of GDevelop-game-templates.'
);
}
const templatesGitPath = args['templatesGitPath'];

/** @typedef {{sha: string, message: string, authorEmail: string}} GitRawCommitInfo */
/** @typedef {{
message: string,
Expand Down Expand Up @@ -321,6 +328,7 @@ const formatHiddenCommitMessage = commit => {
* extensionsCommits: GitEnrichedCommitInfo[] | null,
* assetsCommits: GitEnrichedCommitInfo[] | null,
* examplesCommits: GitEnrichedCommitInfo[] | null,
* templatesCommits: GitEnrichedCommitInfo[] | null
* }} commits
*/
const outputChangelog = ({
Expand All @@ -331,6 +339,7 @@ const outputChangelog = ({
extensionsCommits,
assetsCommits,
examplesCommits,
templatesCommits,
}) => {
shell.echo(
`ℹ️ Hidden these commits: \n${hiddenCommits
Expand Down Expand Up @@ -378,6 +387,14 @@ const outputChangelog = ({
.join('\n')
: 'TODO: Add examples commits here.'
);
shell.echo('\n## 🕹 Premium Game Templates\n');
shell.echo(
templatesCommits
? templatesCommits
.map(commit => formatCommitMessage({ commit, includeAuthor: false }))
.join('\n')
: 'TODO: Add game templates commits here.'
);

if (devCommits.length > 0) {
shell.echo(`\n### 🛠 Internal changes (for developers)\n`);
Expand Down Expand Up @@ -446,6 +463,17 @@ const outputChangelog = ({
);
}

let templatesCommits = null;
if (templatesGitPath) {
const templatesRepoGitTools = getGitTools(templatesGitPath);
const templatesRawCommits = templatesRepoGitTools.extractCommitsSinceDate(
lastTagDate
);
templatesCommits = enrichCommits(templatesRawCommits).filter(
commit => !commit.hidden
);
}

outputChangelog({
hiddenCommits,
improvementsCommits,
Expand All @@ -454,5 +482,6 @@ const outputChangelog = ({
extensionsCommits,
assetsCommits,
examplesCommits,
templatesCommits,
});
})();

0 comments on commit 7c0a7a4

Please sign in to comment.