question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to add and push git tags from the publish command

See original GitHub issue

I’d like an option to have lerna publish from-package to do the same git tagging as lerna version.

This may be related to #1951 .

Expected Behavior

  1. Add an option to the publish command to push tags, or
  2. Add options to the version command to identify which packages will be published, but not bump the version

Current Behavior

lerna version always changes the version unless you run in interactive mode and reset it to the same version. It tags the commit with the versions published at that commit. lerna publish from-package publishes but does not tag the commit.

Possible Solution

Add a --git-tag-version option to the publish from-package command, which tag the commit. I may be able to submit a PR with this after next week.

Another option would be to have the publish command optionally write the published packages to a structured file (json). Then we could just run the version command with the same version to utilize the other commands, such as GitHub releases and tagging.

Context

I’m trying to setup my project such that it publishes unpublished packages from CI on each commit to master. lerna publish from-package does everything I want except the tagging. Next, I’m hoping to push release notes to GitHub which the version command does.

Executable Version
lerna --version 3.13.1
npm --version 6.9.0
yarn --version 1.13.0
node --version v8.15.0
OS Version
macOS Mojave 10.14.4

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:9
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
tkissing-workcommented, May 14, 2019

I don’t know what @goodmorninggoaway wants to do, but I want the same feature, so that I can have a Jenkins pipeline that does everything up to and including lerna version automatically (conventional commits, so no human input needed to figure out the version number), then waits for a human to approve. After approval it should create/push the tag and publish to npm. No more, no less. And before you suggest it, no, I do not want to run version after the human approval because part of the approval process includes reviewing documentation that is generated during version and postversion hooks.

2reactions
goodmorninggoawaycommented, Aug 5, 2020

@bigwoof91 I ended up moving to a different project, so I’m not using let a anymore, but that seems promising if I ever get back to a lerna monorepo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git - Tagging - Git SCM
This command lists the tags in alphabetical order; the order in which they are displayed has ... you can also use the --tags...
Read more >
How do you push a tag to a remote repository using Git?
To push a single tag: git push origin <tag_name>. And the following command should push all tags (not recommended): # not recommended git...
Read more >
How To Create Git Tags - devconnected
To push your newly created tags, use the “git push” command and specify the “–tags” to explicitly push tags to your remote Git...
Read more >
git tag | Atlassian Git Tutorial
To push multiple tags simultaneously pass the --tags option to git push command. When another user clones or pulls a repo they will...
Read more >
Git: Create Tag & Push Tag to Remote - ShellHacks
Push Tag to Remote: The git tag command creates a local tag with the current state of the branch. When pushing to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found