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.

Semver is generating the same version

See original GitHub issue

We integrated continuous deployment on Nx Plugin ngx-deploy-npm and we’re using Semver and its postTargets feature to trigger the deployment.

For some reason, Semver generates the same version when there is nothing new, you can see it here -> https://github.com/bikecoders/ngx-deploy-npm/runs/4091615454?check_suite_focus=true

This causes an unwanted behavior and an error because the tag already exists on the repo.

✔ bumping version in ./packages/ngx-deploy-npm/package.json from 3.0.4 to 3.0.4
✔ outputting changes to ./packages/ngx-deploy-npm/CHANGELOG.md
✔ committing ./packages/ngx-deploy-npm/package.json and ./packages/ngx-deploy-npm/CHANGELOG.md and all staged files
✔ tagging release v3.0.4
fatal: tag 'v3.0.4' already exists

Command failed: git tag -a v3.0.4 -m chore(release): 3.0.4
fatal: tag 'v3.0.4' already exists

The weird thing is when I run this locally it has the expected behavior, do not generate a version

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
aderito7commented, Mar 23, 2022

Been monitoring making use of --base-branch. It worked alright for a few days. Seems that it’s back to giving use the error that tag already exists.

> nx run my-app:version --base=d496cd3ef1 --baseBranch=master --releaseAs=minor 
✔ outputting changes to /builds/apps/my-app/CHANGELOG.md
✔ committing all staged files and %s
Nothing specified, nothing added.
hint: Maybe you wanted to say 'git add .'?
hint: Turn this message off by running
hint: "git config advice.addEmptyPathspec false"
✔ tagging release my-app-0.49.0
fatal: tag 'my-app-0.49.0' already exists
Command failed: git tag -a my-app-0.49.0 -m chore(release): 0.49.0
fatal: tag 'my-app-0.49.0' already exists
Error: Command failed: git tag -a my-app-0.49.0 -m chore(release): 0.49.0
fatal: tag 'my-app-0.49.0' already exists
    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Socket.<anonymous> (node:internal/child_process:450:11)
    at Socket.emit (node:events:394:28)
    at Pipe.<anonymous> (node:net:672:12)
    at Pipe.callbackTrampoline (node:internal/async_hooks:130:17)
———————————————————————————————————————————————
>  NX   ERROR  Running target "my-app:version" failed
  Failed tasks:
  
  - my-app:version
  
  Hint: run the command with --verbose for more details.
1reaction
edbzncommented, Mar 11, 2022

@aderito7 I opened an issue for that, would love to see your contribution!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic Versioning 2.0.0 | Semantic Versioning
Semantic Versioning 2.0.0. Summary. Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes ...
Read more >
How to behave if a project uses SemVer, but its maintainer is ...
Bootstrap uses semver, and bootstrap-sass maintains the same version number, but with the addition of the fourth number to specify ...
Read more >
SemVer versioning: how we handled it with linear interval ...
SemVer versioning representation​​ First, we need a generic representation of a semantic version to start with. We assume that a semantic version ......
Read more >
Semantic Versioning and version number formats - Flownative
In an automated build and deployment pipeline you deal a lot with version numbers. At Flownative, we generally follow the rules of Semantic...
Read more >
SemVer Considered Harmful | Joey Lynch's Site
Most packaging systems (deb, rpm, python, ruby, java, etc …) cannot simultaneously install multiple major versions of the same package name.
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