@ucdjs/release-scripts 0.1.0-beta.54 → 0.1.0-beta.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +25 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2411,6 +2411,29 @@ async function publishPackage(packageName, version, workspaceRoot, options) {
|
|
|
2411
2411
|
|
|
2412
2412
|
//#endregion
|
|
2413
2413
|
//#region src/workflows/publish.ts
|
|
2414
|
+
async function getReleaseBodyFromChangelog(workspaceRoot, packageName, packagePath, version) {
|
|
2415
|
+
const changelogPath = join(packagePath, "CHANGELOG.md");
|
|
2416
|
+
try {
|
|
2417
|
+
const entry = parseChangelog(await readFile(changelogPath, "utf-8")).versions.find((v) => v.version === version);
|
|
2418
|
+
if (!entry) return [
|
|
2419
|
+
`## ${packageName}@${version}`,
|
|
2420
|
+
"",
|
|
2421
|
+
"⚠️ Could not find a matching changelog entry for this version.",
|
|
2422
|
+
"",
|
|
2423
|
+
`Expected version ${version} in ${changelogPath}.`
|
|
2424
|
+
].join("\n");
|
|
2425
|
+
return entry.content.trim();
|
|
2426
|
+
} catch {
|
|
2427
|
+
logger.verbose(`Could not read changelog entry for ${version} at ${changelogPath}`);
|
|
2428
|
+
return [
|
|
2429
|
+
`## ${packageName}@${version}`,
|
|
2430
|
+
"",
|
|
2431
|
+
"⚠️ Could not read package changelog while creating this release.",
|
|
2432
|
+
"",
|
|
2433
|
+
`Expected changelog file: ${changelogPath}`
|
|
2434
|
+
].join("\n");
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2414
2437
|
async function cleanupPublishedOverrides(options, workspacePackages, publishedPackageNames) {
|
|
2415
2438
|
if (publishedPackageNames.length === 0) return false;
|
|
2416
2439
|
if (options.dryRun) {
|
|
@@ -2508,9 +2531,11 @@ async function publishWorkflow(options) {
|
|
|
2508
2531
|
logger.success(`Created and pushed tag ${farver.cyan(tagName)}`);
|
|
2509
2532
|
logger.step(`Creating GitHub release for ${farver.cyan(tagName)}...`);
|
|
2510
2533
|
try {
|
|
2534
|
+
const releaseBody = await getReleaseBodyFromChangelog(options.workspaceRoot, packageName, pkg.path, version);
|
|
2511
2535
|
const releaseResult = await options.githubClient.upsertReleaseByTag({
|
|
2512
2536
|
tagName,
|
|
2513
2537
|
name: tagName,
|
|
2538
|
+
body: releaseBody,
|
|
2514
2539
|
prerelease: Boolean(semver.prerelease(version))
|
|
2515
2540
|
});
|
|
2516
2541
|
if (releaseResult.release.htmlUrl) logger.success(`${releaseResult.created ? "Created" : "Updated"} GitHub release: ${releaseResult.release.htmlUrl}`);
|