Skip to content

Commit

Permalink
chore: update semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Jan 2, 2025
1 parent 30c3177 commit 8149653
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
npm install -g @semantic-release/changelog
npm install -g @semantic-release/git
npm install -g @semantic-release/github
npx semantic-release
npx semantic-release --repository-url https://github.com/vyfor/cord.nvim
luarocks:
name: LuaRocks Publish
Expand All @@ -144,6 +144,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: client-server

- uses: nvim-neorocks/luarocks-tag-release@v7
with:
Expand Down
15 changes: 13 additions & 2 deletions .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,29 @@ module.exports = {
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"writerOpts": {
"headerPartial": "# {{#with context}}{{#if isServerUpdate}}⚙️ {{/if}}{{/with}}[{{currentTag}}]{{#if title}} {{title}}{{/if}}\n\n{{#if date}}_{{date}}_{{/if}}",
"commitPartial": "* {{subject}} ([{{hash}}]({{#if @root.repository}}{{@root.repository}}/commit/{{hash}}{{else}}{{@root.repoUrl}}/commit/{{hash}}{{/if}}))\n",
"mainTemplate": "{{> header}}\n\n{{#each commitGroups}}\n\n{{#if title}}\n### {{title}}\n\n{{/if}}{{#each commits}}{{> commit}}{{/each}}\n{{/each}}\n\n{{> footer}}",
"transform": function (commit, context) {
if (!context.context) context.context = {};

if (commit.scope === 'server') {
context.context.isServerUpdate = true;
}

const shortHash = commit.hash.substring(0, 7);

return {
title: commit.subject,
body: commit.body || ''
type: commit.type,
scope: commit.scope,
subject: commit.subject || '',
hash: shortHash,
shortDesc: commit.subject || '',
body: commit.body || '',
footer: commit.footer || '',
notes: commit.notes || []
};
}
}
Expand Down

0 comments on commit 8149653

Please sign in to comment.