Skip to content

Question: default to patch release #162

@pheenomenon

Description

@pheenomenon

Hi, you have a great well written tool here. am trying it out to simplify my teams release process. CI is on CircleCI. Everything worked like a charm with the default plugins.
However our team is global and our modules will have 95% patch releases. So far difficult to convince my team to bind to a commit convention.
The custom configuration I am exploring is:
1] By default for all/any commit message should do a patch bump.
2] If commit message has type:feat (or an easier identifier for feature) then minor bump.
3] if commit message has "breaking" then major bump.

Based on other closed issues here( #143, #139 ), tried this config in package.json. But this config does not honor the default all commit to patch. CI logs below: Could use some pointers.

"semantic-release": {
    "plugins": [
      [
        "@semantic-release/commit-analyzer",
        {
          "preset": "angular",
          "releaseRules": [
            {
              "breaking": true,
              "release": "major"
            },
            {
              "scope": "no-release",
              "release": false
            },
            {
              "type": "feat",
              "release": "minor"
            },
            {
              "type": "/.*/",
              "release": "patch"
            }
          ],
          "parserOpts": {
            "noteKeywords": [
              "BREAKING CHANGE",
              "BREAKING CHANGES"
            ]
          }
        }
      ],
      "@semantic-release/github",
      "@semantic-release/npm",
      "@semantic-release/release-notes-generator"
    ]
  }
[1:25:34 AM] [semantic-release] › ℹ  Running semantic-release version 16.0.1
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[1:25:34 AM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[1:25:42 AM] [semantic-release] › ✔  Run automated release from branch master
[1:25:42 AM] [semantic-release] › ✔  Allowed to push to the Git repository
[1:25:42 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/npm"
[1:25:42 AM] [semantic-release] [@semantic-release/npm] › ℹ  Verify authentication for registry https://artifactory.corp.com:443/artifactory/api/npm/npm-release-local/
[1:25:42 AM] [semantic-release] [@semantic-release/npm] › ℹ  Reading npm config from /home/circleci/.npmrc
[1:25:42 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/npm"
[1:25:42 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[1:25:42 AM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication (https://git.corp.com/api/v3)
[1:25:43 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[1:25:43 AM] [semantic-release] › ℹ  Found git tag v2.1.0 associated with version 2.1.0 on branch master
[1:25:43 AM] [semantic-release] › ℹ  Found 2 commits since last release
[1:25:43 AM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: adding doctor (#24)
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: corrected spelling for avenger name (#23)
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[1:25:43 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 2 commits complete: no release
[1:25:43 AM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[1:25:43 AM] [semantic-release] › ℹ  There are no relevant changes, so no new version is released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions