最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

npm - How to fix Version Number inconsistency during merges between Develop and Main Branches? - Stack Overflow

programmeradmin3浏览0评论

I'm working on a GitLab CI/CD pipeline where we merge the develop branch into the main branch. However, we've encountered an issue where the version numbers in the package.json file are updated in the main branch during the merge, but not in the develop branch. This leads to a situation where, when merging develop into main again, the version numbers do not increment because the develop branch still holds the old version, preventing a new version from being created.

Here's the relevant part of my .gitlab-ci.yml file for publishing the NPM packages:

.publish_npm_template:
  stage: publish
  script:
    - |
      ng build @Lib/${LIBRARY_DIRECTORY} --configuration=production
      npm version patch
      npm publish to registry

publish_npm_Lib:
  extends: .publish_npm_template
  variables:
    LIBRARY_DIRECTORY: LibDIR
  rules:
    - if: $CI_COMMIT_BRANCH == "main"

How can I ensure that the version numbers are correctly updated in both branches during merges so that new versions are always generated in future pipeline runs?

发布评论

评论列表(0)

  1. 暂无评论