-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from azcraze/feat-semantic-release
Feat semantic release
- Loading branch information
Showing
4 changed files
with
7,600 additions
and
1,245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,4 @@ module.exports = { | |
defaultIssues: '', | ||
defaultScope: '', | ||
defaultSubject: '' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,48 @@ | ||
// in ".releaserc.js" or "release.config.js" | ||
|
||
const { promisify } = require('util') | ||
const dateFormat = require('dateformat') | ||
const readFileAsync = promisify(require('fs').readFile) | ||
|
||
// Given a `const` variable `TEMPLATE_DIR` which points to "<semantic-release-gitmoji>/lib/assets/templates" | ||
const TEMPLATE_DIR = './node_modules/semantic-release-gitmoji' | ||
// the *.hbs template and partials should be passed as strings of contents | ||
const template = readFileAsync(path.join(TEMPLATE_DIR, 'default-template.hbs')) | ||
const commitTemplate = readFileAsync(path.join(TEMPLATE_DIR, 'commit-template.hbs')) | ||
|
||
module.exports = { | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/git", | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "angular", | ||
"writerOpts": { | ||
"commitsSort": ["subject", "scope"] | ||
'branches': ['main', 'devleop'] | ||
plugins: [ | ||
[ | ||
'semantic-release-gitmoji', { | ||
releaseRules: { | ||
major: [ ':boom:' ], | ||
minor: [ ':sparkles:' ], | ||
patch: [ | ||
':bug:', | ||
':ambulance:', | ||
':lock:' | ||
] | ||
}, | ||
releaseNotes: { | ||
template, | ||
partials: { commitTemplate }, | ||
helpers: { | ||
datetime: function (format = 'UTC:yyyy-mm-dd') { | ||
return dateFormat(new Date(), format) | ||
} | ||
}, | ||
"template": "./path/to/release-notes-template.hbs" | ||
issueResolution: { | ||
template: '{baseUrl}/{owner}/{repo}/issues/{ref}', | ||
baseUrl: 'https://github.com', | ||
source: 'github.com', | ||
removeFromCommit: false, | ||
regex: /#\d+/g | ||
} | ||
} | ||
], | ||
"@semantic-release/github" | ||
} | ||
], | ||
"git": { | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${body}\n\n${footer}\n", | ||
"assets": ["CHANGELOG.md"], | ||
"commitHooks": ["npm run lint"] | ||
} | ||
} | ||
|
||
'@semantic-release/github', | ||
'@semantic-release/npm' | ||
] | ||
} |
Oops, something went wrong.