-
Notifications
You must be signed in to change notification settings - Fork 42
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
Question: Migrating from semantic-release to lerna-semantic-release #71
Comments
Hi! Thanks for your question. If I understand correctly, you have a package that is currently working with semantic-release, and you'd like to add lerna to that mixture, so you'll have some new packages. So before you had:
and now you'll have
To achieve this, you'll want to start releasing with Releases
(You can see this behaviour here: https://github.com/atlassian/lerna-semantic-release/blob/caribou/packages/lerna-semantic-release-get-last-release/index.js#L7 . The exception is if the package is private – if it is, it will attempt to use git tags to calculate the last version without looking up the NPM registry. You may need to tag your package in the correct way if it is private, but I suspect it isn't for you, if you're using semantic release now). ChangelogsThere will be some differences in how the changelogs are generated though. Semantic release posts directly to github, but lerna-semantic-release can't really do this, as one repository houses multiple packages. So you'll find that it generates changelogs per directory. Your old commits won't be in the correct format for lerna-semantic-release to pick it up. You could leave the old changelog in a separate file. (There's an issue to make it so that you can enter append mode to preserve the old changelogs: #66 ) The changelog generation itself will look for commits in a specific format, rather than the git tag, to know where old versions were released. ( https://github.com/atlassian/lerna-semantic-release/blob/caribou/packages/lerna-semantic-release-post/index.js#L31 is the code associated with that). This was recently changed to not rely on git tags. A "release" commit looks like this:
If this migration is successful for you I'll add it to the README, so please let us know how it goes for you. Thanks! |
Hi @jpnelson and many thanks for the quick reply! Yes, your assumptions are correct. The library in question - Serenity/JS uses I understand why I have a couple of questions about the changelogs though. Existing release notesSerenity/JS has already had 23 releases. As As release commits act as markers (?), creating just one release commit now would cause My guess is that since the last published release is Release commitsAs Serenity/JS I'm a little bit on the fence regarding the release commits, though. They seem to be just Is there any particular reason why those release commits couldn't be created on a separate branch, akin to github pages (so no source code, just the meta-data)? I see several potential benefits to this approach:
... there's of course a downside of having to parse two branches from What do you think? |
affects: serenity-js@1.2.1 ISSUES CLOSED: atlassian/lerna-semantic-release#71
@jpnelson out of curiosity, what was the reason for #21? The Atlassian wiki does not seem to be accessible to the general public. |
Hi @jan-molak , apologies for the late reply this time – I've added a reference to #21 , see #21 (comment) . I'm also hoping to reply to your other questions some time in the next couple of days :) |
Hey @jpnelson, thanks for getting back to me. I've migrated Serenity/JS to Lerna and Lerna Semantic Release (LSR). The only thing that's missing is some elegant handling of the changelogs. So my outstanding questions could be summed up as:
Thanks! |
OK, so it looks like the last missing piece of the puzzle could be solved with gitbook content references and some hacks to move the files where they should be. Anyway, here's the result of my migration - serenity-js.org/changelog.html |
Hi guys,
First of all, thanks so much for your work on
lerna-semantic-release
! :-)Could you please advise on the best way to migrate from
semantic-release
tolerna-semantic-release
for a project which packages have already been published to NPM?From what I've noticed,
semantic-release
relies on the NPM to find out the last published version and the commit id associated with it, whilelerna-semantic-release
relies on git tagsHow can I inform/guide/trick
lerna-semantic-release
to continue wheresemantic-release
had left? Am I right in assuming that if the git tags are created manually,lerna-semantic-release
should just pick them up?Many thanks,
Jan
The text was updated successfully, but these errors were encountered: