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

Add Prefix and Suffix support to new versions #25

Merged
merged 4 commits into from
Apr 19, 2021
Merged

Conversation

michmich112
Copy link
Owner

@michmich112 michmich112 commented Apr 19, 2021

Allows for defining a prefix and suffix on bumping rules.
Example usage:

{
  "scheme": "semantic",
  "versionFile": "package.json",
  "files": [],
  "rules": [
    {
      "trigger": "commit",
      "prefix": "v."
    },
    {
      "trigger": "commit",
      "bump": "minor",
      "branch": "master",
      "reset": "build"
    },
   {
     "trigger": "commit",
     "bump": "minor",
     "branch": "release-candidate",
     "reset": "build",
     "suffix": "-rc"
   },
   {
     "trigger": "commit",
     "bump": "major",
     "branch": "release",
     "reset": [
       "minor",
       "build"
     ],
     "tag": true
   }
  ]
}

For every commit with a bump, the v. prefix will be applied so we would get v.1.2.3. For every commit in the release-candidate branch the suffix -rc will be applied resulting in: v.1.2.3-rc for release candidate 1.2.3
Note: this will be applied to the version file.

+ added type definitions

Signed-off-by: michmich112 <cantacuzene.michel@gmail.com>
Signed-off-by: michmich112 <cantacuzene.michel@gmail.com>
implemented the application of desired prefix and suffix on bumping versions
- corrected some tests that were not well defined

Signed-off-by: michmich112 <cantacuzene.michel@gmail.com>
Signed-off-by: michmich112 <cantacuzene.michel@gmail.com>
@michmich112 michmich112 added the enhancement New feature or request label Apr 19, 2021
@n0pan
Copy link

n0pan commented Apr 19, 2021

LGTM

@michmich112 michmich112 merged commit 3e60a42 into develop Apr 19, 2021
@michmich112 michmich112 mentioned this pull request Sep 8, 2021
@michmich112 michmich112 deleted the ft/prefix-suffix branch November 23, 2021 08:19
@michmich112 michmich112 linked an issue Dec 5, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add version prefix and version suffix
2 participants