Skip to content

Commit c8a40e8

Browse files
committedJan 19, 2022
ci: update build
1 parent 2073a71 commit c8a40e8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎.github/scripts/build.mjs

+8-4
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,42 @@ for (const id of Object.keys(plugins)) {
3535
const { examples, options, readme, tests, header, community } = await plugin(id)
3636

3737
//Readme
38+
console.log(`Generating source/plugins/${community ? "community/" : ""}${id}/README.md`)
3839
await fs.writeFile(
3940
readme.path,
4041
readme.content
4142
.replace(/(<!--header-->)[\s\S]*(<!--\/header-->)/g, `$1\n${header}\n$2`)
4243
.replace(/(<!--examples-->)[\s\S]*(<!--\/examples-->)/g, `$1\n${examples.map(({ test, prod, ...step }) => ["```yaml", yaml.dump(step, { quotingType: '"', noCompatMode: true }), "```"].join("\n")).join("\n")}\n$2`)
4344
.replace(/(<!--options-->)[\s\S]*(<!--\/options-->)/g, `$1\n${options}\n$2`),
4445
)
45-
console.log(`Generating source/plugins/${community ? "community/" : ""}${id}/README.md`)
46+
staged.add(readme.path)
4647

4748
//Tests
49+
console.log(`Generating tests/plugins/${community ? "community/" : ""}${id}.yml`)
4850
workflow.push(...examples.map(example => testcase(plugins[id].name, "prod", example)).filter(t => t))
4951
await fs.writeFile(tests.path, yaml.dump(examples.map(example => testcase(plugins[id].name, "test", example)).filter(t => t)))
50-
console.log(`Generating tests/plugins/${community ? "community/" : ""}${id}.yml`)
52+
staged.add(tests.path)
5153
}
5254

5355
//Templates
5456
for (const id of Object.keys(templates)) {
5557
const { examples, readme, tests, header } = await template(id)
5658

5759
//Readme
60+
console.log(`Generating source/templates/${id}/README.md`)
5861
await fs.writeFile(
5962
readme.path,
6063
readme.content
6164
.replace(/(<!--header-->)[\s\S]*(<!--\/header-->)/g, `$1\n${header}\n$2`)
6265
.replace(/(<!--examples-->)[\s\S]*(<!--\/examples-->)/g, `$1\n${examples.map(({ test, prod, ...step }) => ["```yaml", yaml.dump(step, { quotingType: '"', noCompatMode: true }), "```"].join("\n")).join("\n")}\n$2`),
6366
)
64-
console.log(`Generating source/templates/${id}/README.md`)
67+
staged.add(readme.path)
6568

6669
//Tests
70+
console.log(`Generating tests/templates/${id}.yml`)
6771
workflow.push(...examples.map(example => testcase(templates[id].name, "prod", example)).filter(t => t))
6872
await fs.writeFile(tests.path, yaml.dump(examples.map(example => testcase(templates[id].name, "test", example)).filter(t => t), { quotingType: '"', noCompatMode: true }))
69-
console.log(`Generating tests/templates/${id}.yml`)
73+
staged.add(tests.path)
7074
}
7175

7276
//Config and general documentation auto-generation

0 commit comments

Comments
 (0)
Failed to load comments.