You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove the dependency on pushToRemote from createRelease or add an additional flag, something like --create-release-only that will create a release without pushing.
Alternatively, we can create the Github release on our own, but since the logic is already built into Lerna it would be helpful to be able to use it.
Context
I am working with a monorepo that has a few packages with one that requires a package-lock. The setup looks a bit like this:
PackageTwo has a dependency on packageOne, but also requires a package-lock for other dependencies. Currently we are manually updating the package-lock in package-two in between lerna version and lerna publish as inspired by #1415 (comment). This is what our CI script looks like:
# Update package versions
lerna version --conventional-commits --create-release github -m '[skip ci] chore(release): publish' --yes --no-push
# Publish new package versions
lerna publish from-package --yes
# Update docs package lock with new package versions
cd packages/packageTwo && npm install packageOne@latest --package-lock-only --ignore-scripts --no-audit && git add ./package-lock.json
# Add package lock to existing versions commit
git commit --amend --no-edit
# Push version and the github releases. Remove --follow-tags to stop github releases
git push origin master --follow-tags
However, since a Github release is never actually created, --follow-tags doesn't push up any tags. Additionally, since we are publishing using from-package we also don't need to push the release to the remote until after the package-lock has been updated. Ideally, the Github release is created and the tags can be pushed manually.
This later results in a problem with lerna changed. Lerna uses the git tags as a diff for which packages needs to be updated. Since the tags/releases are never created or pushed to the remote, lerna changed can't properly determine which packages need to be updated.
Alternatively, if there's a better approach to handling a package-lock, we'd also be happy to try that.
The text was updated successfully, but these errors were encountered:
Thanks @evocateur! I definitely agree that #2160 is the proper solution to all of this. However, since it seems like #2160 has stalled I was hoping to get a workaround, maybe the best answer is to manually handle tagging and creating a release until the update package-lock during versioning bug is resolved?
Expected Behavior
A release should be able to be created even if
lerna version
doesn't handle the push.Current Behavior
lerna version
will not create a release if push is set to false:https://github.com/lerna/lerna/blob/master/commands/version/index.js#L78
Possible Solution
Remove the dependency on
pushToRemote
fromcreateRelease
or add an additional flag, something like--create-release-only
that will create a release without pushing.Alternatively, we can create the Github release on our own, but since the logic is already built into Lerna it would be helpful to be able to use it.
Context
I am working with a monorepo that has a few packages with one that requires a package-lock. The setup looks a bit like this:
PackageTwo has a dependency on packageOne, but also requires a package-lock for other dependencies. Currently we are manually updating the package-lock in package-two in between
lerna version
andlerna publish
as inspired by #1415 (comment). This is what our CI script looks like:However, since a Github release is never actually created,
--follow-tags
doesn't push up any tags. Additionally, since we are publishing usingfrom-package
we also don't need to push the release to the remote until after the package-lock has been updated. Ideally, the Github release is created and the tags can be pushed manually.This later results in a problem with
lerna changed
. Lerna uses the git tags as a diff for which packages needs to be updated. Since the tags/releases are never created or pushed to the remote,lerna changed
can't properly determine which packages need to be updated.Alternatively, if there's a better approach to handling a package-lock, we'd also be happy to try that.
The text was updated successfully, but these errors were encountered: