Skip to content

Commit

Permalink
fix(ci): releases
Browse files Browse the repository at this point in the history
  • Loading branch information
SkeLLLa committed Sep 20, 2024
1 parent a840e5e commit e63f4e4
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 155 deletions.
6 changes: 6 additions & 0 deletions .release/changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = [
'@semantic-release/changelog',
{
changelogFile: 'docs/CHANGELOG.md',
},
];
22 changes: 22 additions & 0 deletions .release/commit-analyzer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = [
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
releaseRules: [
{ breaking: true, release: 'major' },
{ scope: 'release-skip', release: false },
{ type: 'chore', scope: 'release', release: false },
{ scope: 'deps', release: 'patch' },
{ type: 'feat', release: 'minor' },
{ type: 'build', release: 'patch' },
{ type: 'refactor', release: 'patch' },
{ type: 'fix', release: 'patch' },
{ type: 'pref', release: 'patch' },
{ type: 'revert', release: 'patch' },
{ type: 'chore', release: false },
{ type: 'docs', release: false },
{ type: 'style', release: false },
{ type: 'test', release: false },
],
},
];
6 changes: 6 additions & 0 deletions .release/git.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = [
'@semantic-release/git',
{
assets: ['docs', 'package.json', 'pnpm-lock.yaml'],
},
];
6 changes: 6 additions & 0 deletions .release/github.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = [
'@semantic-release/github',
{
message: 'chore(release): ${nextRelease.version} \n\n${nextRelease.notes}',
},
];
14 changes: 14 additions & 0 deletions .release/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
branches: [
{ name: 'master', prerelease: false },
{ name: 'next', prerelease: true },
],
plugins: [
require('./commit-analyzer'),
require('./release-notes'),
require('./changelog'),
require('./npm-publish'),
require('./git'),
require('./github'),
],
};
6 changes: 6 additions & 0 deletions .release/npm-publish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = [
'@semantic-release/npm',
{
npmPublish: true,
},
];
35 changes: 35 additions & 0 deletions .release/release-notes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = [
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
writerOpts: {
groupBy: 'type',
commitGroupsSort: [
'feat',
'fix',
'perf',
'docs',
'revert',
'refactor',
'chore',
],
commitsSort: 'header',
},
presetConfig: {
types: [
{ type: 'build', section: 'πŸ™ CI/CD', hidden: true },
{ type: 'chore', section: '🧾 Other', hidden: false },
{ type: 'ci', section: 'πŸ™ CI/CD', hidden: true },
{ type: 'docs', section: 'πŸ“” Docs', hidden: false },
{ type: 'example', section: 'πŸ“ Examples', hidden: false },
{ type: 'feat', section: 'πŸš€ Features', hidden: false },
{ type: 'fix', section: 'πŸ›  Fixes', hidden: false },
{ type: 'perf', section: '⏩ Performance', hidden: false },
{ type: 'refactor', section: 'βœ‚οΈ Refactor', hidden: false },
{ type: 'revert', section: 'πŸ™…β€οΈ Reverts', hidden: false },
{ type: 'style', section: 'πŸ’ˆ Style', hidden: true },
{ type: 'test', section: 'πŸ§ͺ Tests', hidden: true },
],
},
},
];
92 changes: 1 addition & 91 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -1,91 +1 @@
const changelog = [
'@semantic-release/changelog',
{
changelogFile: 'docs/CHANGELOG.md',
},
];

const commitAnalyzer = [
'@semantic-release/commit-analyzer',
{
preset: 'conventionalcommits',
releaseRules: [
{ breaking: true, release: 'major' },
{ scope: 'release-skip', release: false },
{ type: 'chore', scope: 'release', release: false },
{ scope: 'deps', release: 'patch' },
{ type: 'feat', release: 'minor' },
{ type: 'build', release: 'patch' },
{ type: 'refactor', release: 'patch' },
{ type: 'fix', release: 'patch' },
{ type: 'pref', release: 'patch' },
{ type: 'revert', release: 'patch' },
{ type: 'chore', release: false },
{ type: 'docs', release: false },
{ type: 'style', release: false },
{ type: 'test', release: false },
],
},
];

const git = [
'@semantic-release/git',
{
assets: ['docs', 'package.json'],
},
];

const github = [
'@semantic-release/github',
{
message: 'chore(release): ${nextRelease.version} \n\n${nextRelease.notes}',
},
];

const npm = [
'@semantic-release/npm',
{
npmPublish: true,
},
];

const releaseNotes = [
'@semantic-release/release-notes-generator',
{
preset: 'conventionalcommits',
writerOpts: {
groupBy: 'type',
commitGroupsSort: [
'feat',
'fix',
'perf',
'docs',
'revert',
'refactor',
'chore',
],
commitsSort: 'header',
},
presetConfig: {
types: [
{ type: 'build', section: '🦊 CI/CD', hidden: true },
{ type: 'chore', section: '🧾 Other', hidden: false },
{ type: 'ci', section: '🦊 CI/CD', hidden: true },
{ type: 'docs', section: 'πŸ“” Docs', hidden: false },
{ type: 'example', section: 'πŸ“ Examples', hidden: false },
{ type: 'feat', section: 'πŸš€ Features', hidden: false },
{ type: 'fix', section: 'πŸ›  Fixes', hidden: false },
{ type: 'perf', section: '⏩ Performance', hidden: false },
{ type: 'refactor', section: 'βœ‚οΈ Refactor', hidden: false },
{ type: 'revert', section: 'πŸ™…β€οΈ Reverts', hidden: false },
{ type: 'style', section: 'πŸ’ˆ Style', hidden: true },
{ type: 'test', section: 'πŸ§ͺ Tests', hidden: true },
],
},
},
];

module.exports = {
branches: ['master', 'next'],
plugins: [commitAnalyzer, releaseNotes, changelog, npm, git, github],
};
module.exports = require('./.release');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"@typescript-eslint/eslint-plugin": "^8.6.0",
"@typescript-eslint/parser": "^8.6.0",
"conventional-changelog-cli": "^5.0.0",
"eslint": "^9.10.0",
"conventional-changelog-conventionalcommits": "^8.0.0",
"eslint": "^9.11.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
Expand Down
Loading

0 comments on commit e63f4e4

Please sign in to comment.