0

I am using semantic-release package for automatic versioning. I want to maintenance my old versions. But when i configure the semantic-release like below, consumers who are use old version can not install last update.They always have to specify dist-tag like npm install g-automatic-versioning-test@v3-lts For example my last version is v5.0.0. I have consumers who use v3.1.0 and probably my package is like below on their package system.

{ 
  "dependencies": {
  "g-automatic-versioning-test": "^3.1.0"
  }
}

I developed new feature for v3.1.0 and i released it(it is v3.2.0). But when our consumers run the npm install g-automatic-versionin-test@3 they cant install v3.2.0. They have to type npm install g-automatic-versioning-test@v3-lts. I checked @angularjs/cli library it's not current this situation for this package. When i typed npm install @angular/cli@7 i can install last update in v7.x, even tough last version is v9.0.0 How can i achieve that?

My semantic-release configuration:

const branch = process.env.BITBUCKET_BRANCH;

const config = {
  branches: [
    {name: 'v3-lts', range:'3.x',channel: 'v3-lts', release: 'v3-lts'}, // maintenance branch regex
    {name: 'master', channel: 'latest', release: true },
    {name: 'dev', channel:'beta', prerelease: 'beta' } // you can give another name like 'rc'
  ],
  plugins: [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/npm"
  ],
}
//for package version bumps and changelog to release only when merged to master
if (config.branches.some(it => it === branch || (it.name === branch && !it.prerelease))) {
  config.plugins.push('@semantic-release/changelog', [
    '@semantic-release/git',
    {
      assets: ['CHANGELOG.md', 'package.json']
    },
  ])
}
module.exports = config

Also @angular/cli has same branch structure and channel, where am i doing wrong? What should the dist-tag be?

0 Answers0