Skip to content

Commit

Permalink
feat: show llama.cpp release in GitHub releases (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
giladgd authored Jan 20, 2024
1 parent 2cf74fa commit 36c779d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .releaserc.json

This file was deleted.

49 changes: 49 additions & 0 deletions .releaserc.ts
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"
}]
]
};

0 comments on commit 36c779d

Please sign in to comment.