-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show
llama.cpp
release in GitHub releases (#142)
- Loading branch information
Showing
2 changed files
with
49 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {createRequire} from "module"; | ||
import fs from "fs-extra"; | ||
import {getReleaseInfo} from "./dist/utils/getReleaseInfo.js"; | ||
import {cliBinName, defaultLlamaCppGitHubRepo} from "./dist/config.js"; | ||
|
||
const require = createRequire(import.meta.url); | ||
|
||
const defaultFooterTemplatePath = require.resolve("conventional-changelog-writer/templates/footer.hbs"); | ||
const defaultFooterTemplate = await fs.readFile(defaultFooterTemplatePath, "utf8"); | ||
const releaseInfo = await getReleaseInfo(); | ||
const llamaCppRelease = releaseInfo.llamaCpp.release; | ||
const homepageUrl = require("./package.json").homepage; | ||
const homepageUrlWithoutTrailingSlash = homepageUrl.endsWith("/") | ||
? homepageUrl.slice(0, -1) | ||
: homepageUrl; | ||
|
||
const newFooterTemplate = defaultFooterTemplate + "\n---\n" + | ||
`Shipped with \`llama.cpp\` release: [\`${llamaCppRelease.split("`").join("")}\`](https://github.com/${defaultLlamaCppGitHubRepo}/releases/tag/${encodeURIComponent(llamaCppRelease)}) ` + | ||
`(to use the latest \`llama.cpp\` release available, run \`npx --no ${cliBinName} download --release latest\`. [learn more](${homepageUrlWithoutTrailingSlash}/guide/building-from-source))\n`; | ||
|
||
/** | ||
* @type {import('semantic-release').GlobalConfig} | ||
*/ | ||
export default { | ||
"branches": [ | ||
"master", | ||
{"name": "beta", "prerelease": true} | ||
], | ||
"ci": true, | ||
"plugins": [ | ||
["@semantic-release/commit-analyzer", { | ||
"preset": "angular", | ||
"releaseRules": [ | ||
{"type": "feat", "scope": "minor", "release": "patch"}, | ||
{"type": "docs", "scope": "README", "release": "patch"} | ||
] | ||
}], | ||
["@semantic-release/release-notes-generator", { | ||
"writerOpts": { | ||
"footerPartial": newFooterTemplate | ||
} | ||
}], | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
["@semantic-release/exec", { | ||
"publishCmd": "echo \"${nextRelease.version}\" > .semanticRelease.npmPackage.deployedVersion.txt" | ||
}] | ||
] | ||
}; |