Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract npm and github publish to plugins #515

Merged
merged 2 commits into from
Nov 21, 2017
Merged

Extract npm and github publish to plugins #515

merged 2 commits into from
Nov 21, 2017

Conversation

pvdlg
Copy link
Member

@pvdlg pvdlg commented Nov 20, 2017

  • Add a new plugin type: publish
  • Add support for multi-plugin. A plugin module can now return an object with a property for each plugin type
  • Uses by default npm and github in addition of Travis for the verify condition plugin
  • Uses by default npm and github for the publish plugin
  • gitTag if one can be found is passed to generateNotes for both lastRelease and nextRelease
  • semantic-release now verifies the plugin configuration (in the release property of package.json) and throws an error if it's invalid
  • semantic-release now verifies each plugin output and will throw an error if a plugin returns an unexpected value.

To be merged only when https://github.com/semantic-release/github is released.

Fix #484, Fix #459, Fix #504, Fix #465, Fix #425, Fix #215, Fix #244

@codecov-io
Copy link

codecov-io commented Nov 21, 2017

Codecov Report

Merging #515 into caribou will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           caribou   #515   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           15     13    -2     
  Lines          276    248   -28     
  Branches        45     47    +2     
======================================
- Hits           276    248   -28
Impacted Files Coverage Δ
lib/debug.js 100% <ø> (ø)
lib/logger.js 100% <ø> (ø)
lib/get-version-head.js 100% <100%> (ø)
lib/plugins/definitions.js 100% <100%> (ø)
lib/get-next-version.js 100% <100%> (ø)
lib/plugins/index.js 100% <100%> (ø)
index.js 100% <100%> (ø)
cli.js 100% <100%> (ø)
lib/git.js 100% <100%> (ø)
lib/get-commits.js 100% <100%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3326083...30ad3cf. Read the comment docs.

@gr2m
Copy link
Member

gr2m commented Nov 21, 2017

I’m wondering about the note in the 2nd breaking change:

the npm parameter is not passed to any plugin anymore. Each plugin have to read .npmrc if they needs to.

is there a package you are using to read out the npm rc auth? If yes, maybe we can recommend it in the release notes? No need to update commits, we can update release notes later

@gr2m gr2m self-assigned this Nov 21, 2017
@pvdlg
Copy link
Member Author

pvdlg commented Nov 21, 2017

is there a package you are using to read out the npm rc auth? If yes, maybe we can recommend it in the release notes? No need to update commits, we can update release notes later

I'm using https://github.com/kevva/npm-conf here

I can update the commit as I have to reference https://github.com/semantic-release/github version 1.0.0 when it's released

Copy link
Member

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: whenever you are ready 🎉

@pvdlg pvdlg force-pushed the refactor-plugins branch 2 times, most recently from d605473 to 30ad3cf Compare November 21, 2017 20:25
- Add a new plugin type: `publish`
- Add support for multi-plugin. A plugin module can now return an object with a property for each plugin type
- Uses by default [npm](https://github.com/semantic-release/npm) and [github](https://github.com/semantic-release/github) in addition of Travis for the verify condition plugin
- Uses by default [npm](https://github.com/semantic-release/npm) and [github](https://github.com/semantic-release/github) for the publish plugin
- `gitTag` if one can be found is passed to `generateNotes` for both `lastRelease` and `nextRelease`
- `semantic-release` now verifies the plugin configuration (in the `release` property of `package.json`) and throws an error if it's invalid
- `semantic-release` now verifies each plugin output and will throw an error if a plugin returns an unexpected value.

BREAKING CHANGE: `githubToken`, `githubUrl` and `githubApiPathPrefix` have to be set at the [github](https://github.com/semantic-release/github) plugin level. They can be set via `GH_TOKEN`, `GH_URL` and `GH_PREFIX` environment variables.

BREAKING CHANGE: the `npm` parameter is not passed to any plugin anymore. Each plugin have to read `.npmrc` if they needs to (with https://github.com/kevva/npm-conf for example).
@pvdlg pvdlg merged commit d548edc into caribou Nov 21, 2017
@pvdlg pvdlg deleted the refactor-plugins branch November 21, 2017 21:41
@felixfbecker
Copy link
Contributor

Isn't npm-conf deprecated?

@pvdlg
Copy link
Member Author

pvdlg commented Nov 21, 2017

npmconf is deprecated. npm-conf is not.

@felixfbecker
Copy link
Contributor

felixfbecker commented Nov 21, 2017

Could you give an example how to use an arbitrary shell command as a publish step? E.g. docker push, vsce publish etc

@pvdlg
Copy link
Member Author

pvdlg commented Nov 21, 2017

Could you give an example how to use an arbitrary shell command as a publish step? E.g. docker push, vsce publish etc

That is not possible yet. I'm working on a plugin that would allow to do that.

@felixfbecker
Copy link
Contributor

Do existing plugins like https://github.com/finom/last-release-git sill work with 10.0.0?

Btw, thank you for all the work @pvdlg! These updates are very exciting.

@pvdlg
Copy link
Member Author

pvdlg commented Nov 22, 2017

I cannot tell you about https://github.com/finom/last-release-git
But https://github.com/semantic-release/last-release-git-tag does works with 10.0.0

@felixfbecker
Copy link
Contributor

Even better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants