Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beta and alpha releases do not work #1089

Closed
bmorales-broditec opened this issue Mar 18, 2024 · 6 comments
Closed

beta and alpha releases do not work #1089

bmorales-broditec opened this issue Mar 18, 2024 · 6 comments

Comments

@bmorales-broditec
Copy link

Hello everyone,

I have configured this package for a new project, however I noticed that the alpha and beta releases no longer work as before.

Before:

1.0.0-alpha.0 # npm run alpha-release
1.0.0-alpha.1 # npm run alpha-release
1.0.0-beta.0 # npm run beta-release
1.0.0 # npm run release

Now:

1.0.0 # npm run alpha-release
2.0.0 # npm run alpha-release
3.0.0 # npm run beta-release
4.0.0 # npm run release

My files

package.json

"scripts": {
    "release": "dotenv release-it --",
    "beta-release": "dotenv release-it major --preRelease=beta",
    "alpha-release": "dotenv release-it preminor --preRelease=alpha"
  },
  "release-it": {
    "git": {
      "commitMessage": "chore: release v${version}"
    },
    "gitlab": {
      "release": true
    },
    "npm": {
      "publish": false
    },
    "plugins": {
      "@release-it/conventional-changelog": {
        "infile": "CHANGELOG.md",
        "preset": {
          "name": "conventionalcommits",
          "types": [
            {
              "type": "feat",
              "section": "Features"
            },
            {
              "type": "fix",
              "section": "Bug Fixes"
            }
          ]
        }
      }
    }
  },
  "devDependencies": {
    "@commitlint/cli": "^19.2.0",
    "@commitlint/config-conventional": "^19.1.0",
    "@release-it/conventional-changelog": "^8.0.1",
    "dotenv-cli": "^7.4.1",
    "release-it": "^17.1.1"
  }

commitlint.config.cjs

echo "module.exports = {extends: ['@commitlint/config-conventional']}"
@webpro
Copy link
Collaborator

webpro commented Mar 19, 2024

however I noticed that the alpha and beta releases no longer work as before.

What does "before" mean here?

@bmorales-broditec
Copy link
Author

@webpro Before means when I did npm run beta-release the version it generated was 1.0.0-beta.1, but now it suggests 3.0.0 or 3.0.0-0. I also have husky with other validations, but I don't know if that affects.

@webpro
Copy link
Collaborator

webpro commented Mar 19, 2024

when I did [...], but now

I meant what version of release-it were you using? What's different about the environment/context you're working in that might cause the different behavior/outcome?

@bmorales-broditec
Copy link
Author

bmorales-broditec commented Mar 19, 2024

@webpro The only difference I have seen compared to the other project is that the project is in a subfolder, for example:

The project that does suggest the version well to me

└── project-name
     ├── .env
     ├── .gitignore
     └── README.md

Project I have problems with

└── project-container
     ├── project-name
     ├── .env
     ├── .gitignore
     └── README.md

Because the package versions are the same and I also removed husky to check the validation hooks are not affecting this part.

@webpro
Copy link
Collaborator

webpro commented Apr 5, 2024

OK, so "before" means a different project here.

Either way, I don't have enough information to say something meaningful. I'd like to suggest to read the docs carefully, e.g. this part about how release-it determines the next version: https://github.com/release-it/release-it?tab=readme-ov-file#latest-version

@webpro
Copy link
Collaborator

webpro commented May 8, 2024

Closing due to lack of info/reproducible case.

@webpro webpro closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants