feat(plugins): add getLastRelease hook
The code to determine the last-release is now in its own repository: https://github.com/semantic-release/last-release-npm One can overwrite that behavior by defining a "getLastRelease" plugin. This way one can decouple semantic-release from npm, e.g. by implementing a git-tag based version. This is already worked on: https://github.com/semantic-release/last-release-git-tag Closes #56
This commit is contained in:
committed by
Stephan Bönnemann
parent
77349fcdf1
commit
7ceac76689
+8
-1
@@ -6,9 +6,16 @@ const pre = proxyquire('../../dist/pre', {
|
||||
'child_process': require('../mocks/child-process')
|
||||
})
|
||||
|
||||
const versions = {
|
||||
available: '1.0.0'
|
||||
}
|
||||
|
||||
const plugins = {
|
||||
verifyRelease: (release, cb) => cb(null, release),
|
||||
analyzeCommits: (commits, cb) => cb(null, 'major')
|
||||
analyzeCommits: (commits, cb) => cb(null, 'major'),
|
||||
getLastRelease: ({ pkg }, cb) => {
|
||||
cb(null, { version: versions[pkg.name] || null, gitHead: 'HEAD' })
|
||||
}
|
||||
}
|
||||
|
||||
const npm = {
|
||||
|
||||
Reference in New Issue
Block a user