Can Lerna base the version off git tag history vs. package.json?
See original GitHub issueSorry, this might not be the right place for this question since it’s not a bug but more of a feature request.
I’m trying to figure out the best way to use lerna in a full CI system. Ideally, in a CI system you want the build to be isolated from the release phase. The normal flow for a CI is
PullRequest --> Trigger Build --> Build/Unit Test --> Publish Artifacts
When semantic versioning with lerna is introduced the process becomes
Pull Request --> Trigger Build --> Build/Unit Test --> Read Package.json & Generate Next Semantic Version -> Commit new package.json --> Publish Artifacts
The problem with the second flow is that you are actually modifying the code your building by updating the package.json and commiting it again which in some ways invalidates your original build. You can build it again, but you would have to have some logic to by pass the whole versioning and publishing again. In this case, Lerna just won’t publish it again since there is no major/minor/patch change since only the package.json got updated
Question For a CI system, you don’t want to be modifying code that you are building and publishing. Is there a way for lerna to not depend on the package.json but on the git tags that are generated for the release. It can just grab the latest git tag and increment the major,minor, patch accordingly.
Let me know what your thoughts on this or any suggestions? Thanks, Derek
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8
Top GitHub Comments
I don’t believe you can. The main issue is that the logic is based off the package.json which needs to be checked in. So versioning is based off a file that then needs to be updated and committed. If git tags were used for the last version, this wouldn’t be an issue.
Sent from my iPhone
On Jan 22, 2020, at 6:43 PM, Joe Bowbeer notifications@github.com wrote:
Can you compare and contrast what you are looking for with the from-package option added for #1648https://github.com/lerna/lerna/issues/1648?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/lerna/lerna/issues/2419?email_source=notifications&email_token=AD3MFTT4G2ICXYVGKP22JWDQ7D76BA5CNFSM4KIQ5EZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJV2HXI#issuecomment-577479645, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD3MFTSR6C363HBJV5D4VDLQ7D76BANCNFSM4KIQ5EZA.
Hi Folks 👋
You will have seen in our message above that we at Nrwl are working really hard to bring the lerna repo up to date with what matters most to its community in June 2022.
As previously stated in that message, because we have not heard from the original author of this issue within the last 14 days, we are now automatically closing it.
If any users, including the original author, are still impacted by this issue then we still want to hear from you!
All we ask is that you first update to the latest lerna (
5.1.4
at the time of writing) to make sure it is still reproducible, and then fill out one of our new issue templates, providing all the requested details which apply to your situation:https://github.com/lerna/lerna/issues/new/choose
Many thanks again! 🙏
P.S. Over and above getting to grips with the repo, we have also been hard at work launching a new website, resolving all vulnerabilities, merging exciting new features and reigniting community PR contributions! 🚀
You can read our recent blog post to learn more about what we’ve been up to: https://blog.nrwl.io/lerna-5-1-new-website-new-guides-new-lerna-example-repo-distributed-caching-support-and-speed-64d66410bec7