Skip to content

Commit f8a7f10

Browse files
committed
ci: build plugins
- implement `summarize` Signed-off-by: Yi Huang <[email protected]>
1 parent 59bea93 commit f8a7f10

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,50 @@ jobs:
3030
plugins: ${{ toJSON(matrix.plugins) }}
3131
version: ${{ needs.get-versions.outputs.version }}
3232
secrets: inherit
33+
34+
summarize:
35+
needs:
36+
- get-versions
37+
- parse-plugins
38+
- linux
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/github-script@v7
42+
with:
43+
script: |
44+
const fs = require("fs");
45+
const raw = JSON.parse(fs.readFileSync(".github/plugins.json"));
46+
47+
core.summary.addHeading('Build Summary');
48+
49+
let table = [
50+
{data: 'plugin/platform', header: true},
51+
];
52+
let platforms = [];
53+
Object.entries(raw.platforms).forEach(([key, platform]) => {
54+
table.push({data: key, header: true});
55+
platforms.push(platform.asset_tag);
56+
});
57+
58+
let artifacts = [];
59+
github
60+
.paginate(github.rest.actions.listWorkflowRunArtifacts, {
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
run_id: context.runId,
64+
})
65+
.then((page) => {
66+
artifacts.push(...page);
67+
});
68+
69+
Object.keys(raw.plugins).forEach((plugin) => {
70+
table.push({data: plugin, header: true});
71+
let filtered = artifacts.filter((artifact) => artifact.name.includes(plugin));
72+
platforms.forEach((tag) => {
73+
table.push({
74+
data: filtered.some((artifact) => artifact.name.includes(tag)) ? ':o:' : ':x:'
75+
});
76+
});
77+
});
78+
79+
core.summary.addTable(table);

0 commit comments

Comments
 (0)