Saltstack Official Syslog-NG Formula
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

108 lines
3.7KB

  1. module.exports = {
  2. branch: 'master',
  3. repositoryUrl: 'https://github.com/saltstack-formulas/syslog-ng-formula',
  4. plugins: [
  5. ['@semantic-release/commit-analyzer', {
  6. preset: 'angular',
  7. releaseRules: './release-rules.js',
  8. }],
  9. '@semantic-release/release-notes-generator',
  10. ['@semantic-release/changelog', {
  11. changelogFile: 'CHANGELOG.md',
  12. changelogTitle: '# Changelog',
  13. }],
  14. ['@semantic-release/exec', {
  15. prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}',
  16. }],
  17. ['@semantic-release/git', {
  18. assets: ['*.md', 'docs/*.rst', 'FORMULA'],
  19. }],
  20. '@semantic-release/github',
  21. ],
  22. generateNotes: {
  23. preset: 'angular',
  24. writerOpts: {
  25. // Required due to upstream bug preventing all types being displayed.
  26. // Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
  27. // Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
  28. transform: (commit, context) => {
  29. const issues = []
  30. commit.notes.forEach(note => {
  31. note.title = `BREAKING CHANGES`
  32. })
  33. // NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
  34. if (commit.type === `feat`) {
  35. commit.type = `Features`
  36. } else if (commit.type === `fix`) {
  37. commit.type = `Bug Fixes`
  38. } else if (commit.type === `perf`) {
  39. commit.type = `Performance Improvements`
  40. } else if (commit.type === `revert`) {
  41. commit.type = `Reverts`
  42. } else if (commit.type === `docs`) {
  43. commit.type = `Documentation`
  44. } else if (commit.type === `style`) {
  45. commit.type = `Styles`
  46. } else if (commit.type === `refactor`) {
  47. commit.type = `Code Refactoring`
  48. } else if (commit.type === `test`) {
  49. commit.type = `Tests`
  50. } else if (commit.type === `build`) {
  51. commit.type = `Build System`
  52. // } else if (commit.type === `chore`) {
  53. // commit.type = `Maintenance`
  54. } else if (commit.type === `ci`) {
  55. commit.type = `Continuous Integration`
  56. } else {
  57. return
  58. }
  59. if (commit.scope === `*`) {
  60. commit.scope = ``
  61. }
  62. if (typeof commit.hash === `string`) {
  63. commit.shortHash = commit.hash.substring(0, 7)
  64. }
  65. if (typeof commit.subject === `string`) {
  66. let url = context.repository
  67. ? `${context.host}/${context.owner}/${context.repository}`
  68. : context.repoUrl
  69. if (url) {
  70. url = `${url}/issues/`
  71. // Issue URLs.
  72. commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
  73. issues.push(issue)
  74. return `[#${issue}](${url}${issue})`
  75. })
  76. }
  77. if (context.host) {
  78. // User URLs.
  79. commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
  80. if (username.includes('/')) {
  81. return `@${username}`
  82. }
  83. return `[@${username}](${context.host}/${username})`
  84. })
  85. }
  86. }
  87. // remove references that already appear in the subject
  88. commit.references = commit.references.filter(reference => {
  89. if (issues.indexOf(reference.issue) === -1) {
  90. return true
  91. }
  92. return false
  93. })
  94. return commit
  95. },
  96. },
  97. },
  98. };