-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Do not depends on package.json and use new repositoryUrl
BREAKING CHANGE: Require semantic-release version that pass the `repositoryUrl` option BREAKING CHANGE: Return async function instead of function calling a callback
- Loading branch information
Showing
7 changed files
with
79 additions
and
125 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 |
---|---|---|
@@ -1,30 +1,29 @@ | ||
const {callbackify} = require('util'); | ||
const verifyGithub = require('./lib/verify'); | ||
const publishGit = require('./lib/publish'); | ||
const publishGithub = require('./lib/publish'); | ||
|
||
let verified; | ||
|
||
async function verifyConditions(pluginConfig, {pkg, options: {publish}}) { | ||
async function verifyConditions(pluginConfig, {options}) { | ||
// If the Github publish plugin is used and has `assets` configured, validate it now in order to prevent any release if the configuration is wrong | ||
if (publish) { | ||
const publishPlugin = (Array.isArray(publish) ? publish : [publish]).find( | ||
if (options.publish) { | ||
const publishPlugin = (Array.isArray(options.publish) ? options.publish : [options.publish]).find( | ||
config => config.path && config.path === '@semantic-release/github' | ||
); | ||
if (publishPlugin && publishPlugin.assets) { | ||
pluginConfig.assets = publishPlugin.assets; | ||
} | ||
} | ||
|
||
await verifyGithub(pluginConfig, pkg); | ||
await verifyGithub(pluginConfig, options); | ||
verified = true; | ||
} | ||
|
||
async function publish(pluginConfig, {pkg, nextRelease, options, logger}) { | ||
async function publish(pluginConfig, {nextRelease, options, logger}) { | ||
if (!verified) { | ||
await verifyGithub(pluginConfig, pkg); | ||
await verifyGithub(pluginConfig, options); | ||
verified = true; | ||
} | ||
await publishGit(pluginConfig, options, pkg, nextRelease, logger); | ||
await publishGithub(pluginConfig, options, nextRelease, logger); | ||
} | ||
|
||
module.exports = {verifyConditions: callbackify(verifyConditions), publish: callbackify(publish)}; | ||
module.exports = {verifyConditions, publish}; |
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
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
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
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
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
Oops, something went wrong.