Skip to content

Commit

Permalink
feat: Move metadata to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
shdwmtr committed Dec 10, 2024
1 parent dd82802 commit 3ecd094
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ jobs:
cd ..
done
node ./scripts/release.js
- name: Zip folders in /dist
run: |
mkdir -p build
Expand Down
9 changes: 7 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"./scripts/release.js",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/git",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "metadata.json"]
}
],
{
"path": "@semantic-release/github",
"assets": ["build/*.zip"]
Expand Down
21 changes: 8 additions & 13 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,12 @@ const ParsePlugin = (pluginsDir, submodule) => {
}


module.exports = {
generateNotes: async () => {
const pluginsDir = path.resolve(process.cwd(), 'plugins');
let pluginIds = [];
let releaseNotes = '```json\n';

if (fs.existsSync(pluginsDir)) {
fs.readdirSync(pluginsDir).forEach(submodule => { pluginIds.push(ParsePlugin(pluginsDir, submodule)); });
}
const pluginsDir = path.resolve(process.cwd(), 'plugins');
let pluginIds = [];

releaseNotes += JSON.stringify(pluginIds, null, 4);
return releaseNotes + '\n```';
}
};
if (fs.existsSync(pluginsDir)) {
fs.readdirSync(pluginsDir).forEach(submodule => { pluginIds.push(ParsePlugin(pluginsDir, submodule)); });
}

// write JSON to metadata.json
fs.writeFileSync(path.resolve(process.cwd(), 'metadata.json'), JSON.stringify(pluginIds, null, 4));

0 comments on commit 3ecd094

Please sign in to comment.