Version not bumping
See original GitHub issueI have a remote instance (Jenkins) running the release script. That’s been working fine but running it on a new instance is producing different results. The issue is that the bump part of the release script is not occurring. The script is literally the same and I’m using npm ci
to ensure the package versions are consistent.
Any thought on why this could produce different results running the same script on different systems? Are there some git repository expectations that might be missing? It produces the right tag it’s just not bumping the version.
New instance output. Note the missing bump logs.
+ npm run release -- --release-as patch
> @mob/mobile@1.0.0 release /var/lib/jenkins/workspace/commonjsmodule-publish_master
> standard-version "--release-as" "patch"
✔ outputting changes to CHANGELOG.md
✔ committing CHANGELOG.md
✔ tagging release v1.0.1
ℹ Run `git push --follow-tags origin master` to publish
Running locally.
$ npm run release -- --release-as major
> @mob/mobile@1.0.0 release /Users/ralph.smith/Workspace/mobile
> standard-version "--release-as" "patch"
✔ bumping version in package.json from 1.0.0 to 1.0.1
✔ bumping version in package-lock.json from 1.0.0 to 1.0.1
✔ outputting changes to CHANGELOG.md
✔ committing package-lock.json and package.json and CHANGELOG.md
✔ tagging release v1.0.1
ℹ Run `git push --follow-tags origin master && npm publish` to publish
Here’s a historical log from the old instance that’s been working fine:
+ npm run release -- --release-as patch
> @mob/mobile@0.1.0 release /var/jenkins_home/workspace/_commonjsmodule-publish_master_2
> standard-version "--release-as" "patch"
✔ bumping version in package.json from 0.1.0 to 0.1.1
✔ bumping version in package-lock.json from 0.1.0 to 0.1.1
✔ outputting changes to CHANGELOG.md
✔ committing package-lock.json and package.json and CHANGELOG.md
✔ tagging release v0.1.1
ℹ Run `git push --follow-tags origin master && npm publish` to publish
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:9
Top Results From Across the Web
release reminder or commit blocker when no version bump
I am looking for a way to get this working. version (A). check package.json of mono-repo and read file last commit ID (usually...
Read more >not receive notification after successful push to bioconductor ...
I successfully pushed updates of package RiboDiPA to bioconductor with version bump, but didn't receive automatic notification from bioconductor. Any clues on ...
Read more >Semantic Versioning 2.0.0 | Semantic Versioning
In systems with many dependencies, releasing new package versions can quickly become a nightmare. If the dependency specifications are too tight, ...
Read more >npm-version - npm Docs
Bump a package version. ... Whether or not to output JSON data, rather than the normal output. In npm pkg set it enables...
Read more >Major Version Numbers are Not Sacred - Tom Preston-Werner
In that world, the minor versions would contain breaking changes, especially for products with large API surface areas. Bumping the major ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
so after some digging around I figured out how to solve it for my use case. If you look at the library source, you’ll see that it checks if the
package.json
is gitignored and if it is it just returns from the function without bumping the versionhttps://github.com/conventional-changelog/standard-version/blob/master/lib/lifecycles/bump.js#L146
In my case, I’m working on a library that builds into
lib
folder, so we addedlib
to .gitgnore. It works just fine on local but fails in jenkins because jenkins workplace is located in/var/lib/jenkins/workspace/<your_repo>
, since jenkins workplace is located underlib
directory andlib
is gitignored this condition becomes truthy in jenkinsif (dotgit.ignore(configPath)) return
so it just returns and doesn’t bump the version up.The way I solved is I changed the output directory of my library from
lib
todist
, removedlib
from.gitignore
and addeddist
instead. After this change it worked as expected.It would be nice if this was documented tho, or at least a warning in the console would have helped to save a LOT of time and headache.
I hope this helps the next person who runs into this.
@praneybehl We (speaking for @droshev here too) found the 🐛 for our implementation at least - it ended up being something in our
.gitignore
triggering this line: https://github.com/conventional-changelog/standard-version/blob/master/lib/lifecycles/bump.js#L155See https://github.com/SAP/fundamental-styles/pull/1289
Hope that helps you too!