Skip to content

Commit 3ecd094

Browse files
committed
feat: Move metadata to repo
1 parent dd82802 commit 3ecd094

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ jobs:
6767
cd ..
6868
done
6969
70+
node ./scripts/release.js
71+
7072
- name: Zip folders in /dist
7173
run: |
7274
mkdir -p build

.releaserc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
"branches": ["main"],
33
"plugins": [
44
"@semantic-release/commit-analyzer",
5-
"./scripts/release.js",
5+
"@semantic-release/release-notes-generator",
66
"@semantic-release/changelog",
7-
"@semantic-release/git",
7+
[
8+
"@semantic-release/git",
9+
{
10+
"assets": ["CHANGELOG.md", "metadata.json"]
11+
}
12+
],
813
{
914
"path": "@semantic-release/github",
1015
"assets": ["build/*.zip"]

scripts/release.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,12 @@ const ParsePlugin = (pluginsDir, submodule) => {
3535
}
3636

3737

38-
module.exports = {
39-
generateNotes: async () => {
40-
const pluginsDir = path.resolve(process.cwd(), 'plugins');
41-
let pluginIds = [];
42-
let releaseNotes = '```json\n';
43-
44-
if (fs.existsSync(pluginsDir)) {
45-
fs.readdirSync(pluginsDir).forEach(submodule => { pluginIds.push(ParsePlugin(pluginsDir, submodule)); });
46-
}
38+
const pluginsDir = path.resolve(process.cwd(), 'plugins');
39+
let pluginIds = [];
4740

48-
releaseNotes += JSON.stringify(pluginIds, null, 4);
49-
return releaseNotes + '\n```';
50-
}
51-
};
41+
if (fs.existsSync(pluginsDir)) {
42+
fs.readdirSync(pluginsDir).forEach(submodule => { pluginIds.push(ParsePlugin(pluginsDir, submodule)); });
43+
}
44+
45+
// write JSON to metadata.json
46+
fs.writeFileSync(path.resolve(process.cwd(), 'metadata.json'), JSON.stringify(pluginIds, null, 4));

0 commit comments

Comments
 (0)