Skip to content

Commit

Permalink
new: Support nested changelogs.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Feb 3, 2024
1 parent 137fde0 commit 6ade718
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.3.2

- Support changelogs within each crate, instead of just the root.

# 0.3.1

- Fixed broken tag parsing.
Expand Down
7 changes: 6 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function getRoot(): string {
let TAG: string | null = null;
let PLUGIN: string | null = null;
let PLUGIN_VERSION: string | null = null;
let PLUGIN_ROOT: string | null = null;

function detectVersionAndProject() {
const ref = process.env.GITHUB_REF;
Expand Down Expand Up @@ -184,6 +185,10 @@ async function findBuildablePackages() {
});
}
});

if (PLUGIN) {
PLUGIN_ROOT = path.dirname(pkg.manifest_path);
}
});

core.info(`Found ${builds.length} builds`);
Expand Down Expand Up @@ -248,7 +253,7 @@ async function extractChangelog() {
let changelogPath = null;

for (const lookup of ['CHANGELOG.md', 'CHANGELOG', 'HISTORY.md', 'HISTORY']) {
const lookupPath = path.join(getRoot(), lookup);
const lookupPath = path.join(PLUGIN_ROOT ?? getRoot(), lookup);

if (fs.existsSync(lookupPath)) {
changelogPath = lookupPath;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonrepo/build-wasm-plugin",
"version": "0.3.1",
"version": "0.3.2",
"description": "A GitHub action to build, optimize, and prepare WASM plugins for release.",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 6ade718

Please sign in to comment.