()
| 27 | |
| 28 | // Declare semantic config |
| 29 | async function config() { |
| 30 | |
| 31 | // Get branch |
| 32 | const branch = ref?.split('/')?.pop()?.split('-')[0] || '(current branch could not be determined)'; |
| 33 | // eslint-disable-next-line no-console |
| 34 | console.log(`Running on branch: ${branch}`); |
| 35 | |
| 36 | // Set changelog file |
| 37 | const changelogFileSuffix = branch.match(/release-\d+\.x\.x/) ? 'release' : branch; |
| 38 | const changelogFile = `./changelogs/CHANGELOG_${changelogFileSuffix}.md`; |
| 39 | // eslint-disable-next-line no-console |
| 40 | console.log(`Changelog file output to: ${changelogFile}`); |
| 41 | |
| 42 | // Load template file contents |
| 43 | await loadTemplates(); |
| 44 | |
| 45 | const config = { |
| 46 | branches: [ |
| 47 | 'release', |
| 48 | { name: 'alpha', prerelease: true }, |
| 49 | // { name: 'beta', prerelease: true }, |
| 50 | // Long-Term-Support branch |
| 51 | { name: 'release-9.x.x', range: '9.x.x', channel: '9.x.x' }, |
| 52 | ], |
| 53 | dryRun: false, |
| 54 | debug: true, |
| 55 | ci: true, |
| 56 | tagFormat: '${version}', |
| 57 | plugins: [ |
| 58 | ['@semantic-release/commit-analyzer', { |
| 59 | preset: 'angular', |
| 60 | releaseRules: [ |
| 61 | { type: 'docs', scope: 'README', release: 'patch' }, |
| 62 | { scope: 'no-release', release: false }, |
| 63 | ], |
| 64 | parserOpts: { |
| 65 | noteKeywords: ['BREAKING CHANGE'], |
| 66 | }, |
| 67 | }], |
| 68 | ['@semantic-release/release-notes-generator', { |
| 69 | preset: 'angular', |
| 70 | parserOpts: { |
| 71 | noteKeywords: ['BREAKING CHANGE'] |
| 72 | }, |
| 73 | writerOpts: { |
| 74 | commitsSort: ['subject', 'scope'], |
| 75 | mainTemplate: templates.main.text, |
| 76 | headerPartial: templates.header.text, |
| 77 | commitPartial: templates.commit.text, |
| 78 | footerPartial: templates.footer.text, |
| 79 | }, |
| 80 | }], |
| 81 | ['@semantic-release/changelog', { |
| 82 | 'changelogFile': changelogFile, |
| 83 | }], |
| 84 | ['@semantic-release/npm', { |
| 85 | 'npmPublish': true, |
| 86 | }], |
no test coverage detected