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

How to bump from 0.x.x to 1.x.x version? #982

Closed
ruggero-visintin opened this issue Aug 12, 2021 · 6 comments · Fixed by #1018
Closed

How to bump from 0.x.x to 1.x.x version? #982

ruggero-visintin opened this issue Aug 12, 2021 · 6 comments · Fixed by #1018

Comments

@ruggero-visintin
Copy link

Hi there,

We tried to bump a release containing braking changes but we still get a simple minor bump instead of a major bump (which we would expect). After digging for the root cause, we found this issue that confirms it's intended here and here.

That said, we don't understand how we should proceed to bump to a 1.x.x version, and therefore have breaking changes effectively bump major version instead of minor.

We've tried some different approaches but none has succeeded in bumping and releasing a 1.0.0 version.

Hope you can help us,
Thanks a lot!

@hoegertn
Copy link
Contributor

Semantic versioning works differently for versions starting with 0.. Everything before 1.0.0 is considered experimental and breaking changes are only minor version bumps. The moment you feel comfortable you need to bump the version manually to 1.0.0 and then the well-known versioning kicks in where breaking changes bump the major version, features bump the minor and fixes bump the patch version.

@ruggero-visintin
Copy link
Author

ruggero-visintin commented Aug 13, 2021

Thanks for the reply.

We've tried to manually bump the version to 1.0.0 but the result is a failure at the Anti-tamper check. So we thought it wasn't the right way to do it.

Maybe we are missing something? How can we bump manually and avoid the anti-tamper check failing?

@eladb
Copy link
Contributor

eladb commented Aug 31, 2021

@ruggero-visintin this is not well-documented, but you can just set majorVersion of your project to 1 and projen should take care of the rest:

const project = new TypeScriptProject({
  // ...
  majorVersion: 1,
});

You can also specify multiple release branches, and set a different major version for each one:

  releaseBranches: {
    '2.x': {
      majorVersion: 2,
    },
    '3.x': {
      majorVersion: 3,
      prerelease: true,
    },
  },

I am closing for now, feel free to comment if you still have any questions on the topic.

@eladb
Copy link
Contributor

eladb commented Aug 31, 2021

Added minimal docs: #1018

@samson-sham
Copy link

Hi, how is the version be automatically taken care?
I did

const project = new awscdk.AwsCdkTypeScriptApp({
  majorVersion: 1,
})

and execute npx projen, nothing change on my package.json.
I tried git commit with "feat: message", nothing change again.
then execute npx projen again, nothing has changed.

Does this require GitHub workflows to work?

@mrgrain
Copy link
Contributor

mrgrain commented Jan 18, 2023

projen uses git tags for versioning, GHA workflows are not required.

It's all documented in the docs: https://projen.io/releases.html

There's also a workaround to manually set the version in package.json
#2334 (comment)

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

Successfully merging a pull request may close this issue.

5 participants