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

Question: default to patch release #162

Closed
pheenomenon opened this issue Jan 14, 2020 · 9 comments
Closed

Question: default to patch release #162

pheenomenon opened this issue Jan 14, 2020 · 9 comments
Labels

Comments

@pheenomenon
Copy link

pheenomenon commented Jan 14, 2020

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.
@pvdlg
Copy link
Member

pvdlg commented Jan 14, 2020

Regex are not supported anymore and have been replaced by globs. See v7.0.0

Regexp are not supported anymore for property matching in the releaseRules option.
Regex are replaced by globs. For example /core-.*/ should be changed to core-*.

@pvdlg pvdlg closed this as completed Jan 14, 2020
@pvdlg pvdlg added the support label Jan 14, 2020
@pheenomenon
Copy link
Author

pheenomenon commented Jan 14, 2020

Thanks @pvdlg will tryout with globs,

{
              "type": "*",
              "release": "patch"
}

@pheenomenon
Copy link
Author

pheenomenon commented Jan 14, 2020

Hello @pvdlg
below is what I have in my package.json , but none of the commits were picked up by commit-analyzer. I am starting to think that my reading of configuration is not correct or defining "@semantic-release/commit-analyzer": "^7.0.0" is not required.

  "devDependencies": {
    "@semantic-release/commit-analyzer": "^7.0.0",
    "chai": "^4.2.0",
    "mocha": "^7.0.0",
    "semantic-release": "^16.0.1"
  },
  "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"
    ]
  }

CI Logs:

[5:26:22 AM] [semantic-release] › ℹ  Running semantic-release version 16.0.1
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[5:26:22 AM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[5:26:23 AM] [semantic-release] › ✔  Run automated release from branch master
[5:26:23 AM] [semantic-release] › ✔  Allowed to push to the Git repository
[5:26:23 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/npm"
[5:26:23 AM] [semantic-release] [@semantic-release/npm] › ℹ  Verify authentication for registry https://artifactory.corp.com:443/artifactory/api/npm/npm-release-local/
[5:26:23 AM] [semantic-release] [@semantic-release/npm] › ℹ  Reading npm config from /home/circleci/.npmrc
[5:26:23 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/npm"
[5:26:23 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[5:26:23 AM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication (https://git.corp.com/api/v3)
[5:26:23 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[5:26:23 AM] [semantic-release] › ℹ  Found git tag v2.1.0 associated with version 2.1.0 on branch master
[5:26:23 AM] [semantic-release] › ℹ  Found 8 commits since last release
[5:26:23 AM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: more debugging (#30)
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: corrected names (#29)
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: BREAKING CHANGE: api changed for random (#28)
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: breaking: api changed (#27)
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: add a new hero (#26)
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: correcting doctor name (#25)
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: adding doctor (#24)
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: corrected spelling for avenger name (#23)
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[5:26:23 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 8 commits complete: no release
[5:26:23 AM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[5:26:23 AM] [semantic-release] › ℹ  There are no relevant changes, so no new version is released.

@pvdlg
Copy link
Member

pvdlg commented Jan 14, 2020

Please see https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration-file

The correct property in package.json is release

@pheenomenon
Copy link
Author

@pvdlg thank you!
will change the configuration. Found a sample here https://github.com/blackflux/lambda-tdd/blob/master/.releaserc.json will try to use .releaserc.json instead.

@pheenomenon
Copy link
Author

@pvdlg Definitely got a better understanding of how the configs work using --debug, but havent completely figured out the default to patch release

1] By default for all/any commit message should do a patch bump.

1] also works only if the commit message has the format SomeTag: some description but not if msg is in non-conventional format like: some commit description. Trying to understand how this code works:

isMatchWith(commit, rule, (obj, src) =>

{
        "tag": "*",
        "release": "patch"
}

in .releaserc.json, I was hoping for any non-conventional commit message(other than Breaking: & New:) without any AnyTag: to trigger a patch release.

Below are .releaserc.json and CI logs

{
  "analyzeCommits": {
    "preset": "eslint",
    "releaseRules": [
      {
        "tag": "Breaking",
        "release": "major"
      },
      {
        "tag": "New",
        "release": "minor"
      },
      {
        "tag": "*",
        "release": "patch"
      },
      {
        "scope": "no-release",
        "release": false
      }
    ],
    "parserOpts": {
      "noteKeywords": [
        "BREAKING CHANGE",
        "BREAKING CHANGES"
      ]
    }
  }
}

Logs with debug on:

[9:13:20 PM] [semantic-release] › ℹ  Running semantic-release version 16.0.1
  semantic-release:config load config from: /home/circleci/project/.releaserc.json +0ms
  semantic-release:config options values: {
  semantic-release:config   branches: [
  semantic-release:config     '+([0-9])?(.{+([0-9]),x}).x',
  semantic-release:config     'master',
  semantic-release:config     'next',
  semantic-release:config     'next-major',
  semantic-release:config     { name: 'beta', prerelease: true },
  semantic-release:config     { name: 'alpha', prerelease: true }
  semantic-release:config   ],
  semantic-release:config   repositoryUrl: 'https://git.corp.domain.com/new/dummy-cci-release.git',
  semantic-release:config   tagFormat: 'v${version}',
  semantic-release:config   plugins: [
  semantic-release:config     '@semantic-release/commit-analyzer',
  semantic-release:config     '@semantic-release/release-notes-generator',
  semantic-release:config     '@semantic-release/npm',
  semantic-release:config     '@semantic-release/github'
  semantic-release:config   ],
  semantic-release:config   analyzeCommits: {
  semantic-release:config     preset: 'eslint',
  semantic-release:config     releaseRules: [ [Object], [Object], [Object], [Object] ],
  semantic-release:config     parserOpts: { noteKeywords: [Array] }
  semantic-release:config   },
  semantic-release:config   _: [],
  semantic-release:config   debug: true,
  semantic-release:config   '$0': 'node_modules/.bin/semantic-release'
  semantic-release:config } +3ms
  semantic-release:plugins options for @semantic-release/npm/verifyConditions: {} +0ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
  semantic-release:plugins options for @semantic-release/github/verifyConditions: {} +1ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
  semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: {
  semantic-release:plugins   preset: 'eslint',
  semantic-release:plugins   releaseRules: [
  semantic-release:plugins     { tag: 'Breaking', release: 'major' },
  semantic-release:plugins     { tag: 'New', release: 'minor' },
  semantic-release:plugins     { tag: '*', release: 'patch' },
  semantic-release:plugins     { scope: 'no-release', release: false }
  semantic-release:plugins   ],
  semantic-release:plugins   parserOpts: { noteKeywords: [ 'BREAKING CHANGE', 'BREAKING CHANGES' ] }
  semantic-release:plugins } +1ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
  semantic-release:plugins options for @semantic-release/release-notes-generator/generateNotes: {} +1ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
  semantic-release:plugins options for @semantic-release/npm/prepare: {} +0ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
  semantic-release:plugins options for @semantic-release/npm/publish: {} +0ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
  semantic-release:plugins options for @semantic-release/github/publish: {} +1ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
  semantic-release:plugins options for @semantic-release/npm/addChannel: {} +0ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
  semantic-release:plugins options for @semantic-release/github/addChannel: {} +0ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
  semantic-release:plugins options for @semantic-release/github/success: {} +1ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
  semantic-release:plugins options for @semantic-release/github/fail: {} +0ms
[9:13:21 PM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
  semantic-release:get-tags found tags for branch master: [ { gitTag: 'v1.0.0', version: '1.0.0', channels: [ null ] }, { gitTag: 'v1.1.0', version: '1.1.0', channels: [ null ] }, { gitTag: 'v1.2.0', version: '1.2.0', channels: [ null ] }, { gitTag: 'v1.2.1', version: '1.2.1', channels: [ null ] }, { gitTag: 'v2.0.0', version: '2.0.0', channels: [ null ] }, { gitTag: 'v2.1.0', version: '2.1.0', channels: [ null ] }, { gitTag: 'v2.1.1', version: '2.1.1', channels: [ null ] }, { gitTag: 'v3.0.0', version: '3.0.0', channels: [ null ] }, { gitTag: 'v4.0.0', version: '4.0.0', channels: [ null ] }, { gitTag: 'v4.1.0', version: '4.1.0', channels: [ null ] }, { gitTag: 'v4.2.0', version: '4.2.0', channels: [ null ] } ] +0ms
[9:13:22 PM] [semantic-release] › ✔  Run automated release from branch master
[9:13:22 PM] [semantic-release] › ✔  Allowed to push to the Git repository
[9:13:22 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/npm"
[9:13:22 PM] [semantic-release] [@semantic-release/npm] › ℹ  Verify authentication for registry https://artifactory.corp.domain.com:443/artifactory/api/npm/npm-new-release-local/
[9:13:22 PM] [semantic-release] [@semantic-release/npm] › ℹ  Reading npm config from /home/circleci/.npmrc
[9:13:22 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/npm"
[9:13:22 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[9:13:22 PM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication (https://git.corp.domain.com/api/v3)
[9:13:22 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[9:13:22 PM] [semantic-release] › ℹ  Found git tag v4.2.0 associated with version 4.2.0 on branch master
  semantic-release:get-commits Use from: a8dec285ff3c4b3ae90e716d7ed4e0f069d2e255 +0ms
[9:13:22 PM] [semantic-release] › ℹ  Found 2 commits since last release
  semantic-release:get-commits Parsed commits: [ { commit: { long: 'ec3fa9c745b03e9a26634900d7b0c828c5064ef5', short: 'ec3fa9c' }, tree: { long: '74325954d614be812042ce42dae63b47d866eb58', short: '7432595' }, author: { name: 'kuser', email: 'kuser@domain.com', date: 2020-01-14T21:09:35.000Z }, committer: { name: 'GitHub Enterprise', email: 'noreply@domain.com', date: 2020-01-14T21:09:35.000Z }, subject: 'Any: adding hero Jackie (#40)', body: '', hash: 'ec3fa9c745b03e9a26634900d7b0c828c5064ef5', committerDate: 2020-01-14T21:09:35.000Z, message: 'Any: adding hero Jackie (#40)', gitTags: '(HEAD -> master, origin/master, origin/HEAD)' }, { commit: { long: '114d9a484a3fd256e1846ee196f3e8e79988baf0', short: '114d9a4' }, tree: { long: '704aa06ea73f1725d3239bb9edb16f8ccf5572cf', short: '704aa06' }, author: { name: 'kuser', email: 'kuser@domain.com', date: 2020-01-14T20:38:28.000Z }, committer: { name: 'GitHub Enterprise', email: 'noreply@domain.com', date: 2020-01-14T20:38:28.000Z }, subject: 'removing heman (#39)', body: '', hash: '114d9a484a3fd256e1846ee196f3e8e79988baf0', committerDate: 2020-01-14T20:38:28.000Z, message: 'removing heman (#39)', gitTags: '' } ] +19ms
[9:13:22 PM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[9:13:22 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Any: adding hero Jackie (#40)
  semantic-release:commit-analyzer Analyzing with custom rules +0ms
  semantic-release:commit-analyzer The rule { tag: '*', release: 'patch' } match commit with release type 'patch' +0ms
[9:13:22 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
[9:13:22 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: removing heman (#39)
  semantic-release:commit-analyzer Analyzing with custom rules +12ms
  semantic-release:commit-analyzer Analyzing with default rules +1ms
[9:13:22 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[9:13:22 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 2 commits complete: patch release
[9:13:22 PM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[9:13:22 PM] [semantic-release] › ℹ  The next release version is 4.2.1
[9:13:22 PM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
  semantic-release:release-notes-generator version: '4.2.1' +0ms
  semantic-release:release-notes-generator host: undefined +0ms
  semantic-release:release-notes-generator owner: 'new' +0ms
  semantic-release:release-notes-generator repository: 'dummy-cci-release' +0ms
  semantic-release:release-notes-generator previousTag: 'v4.2.0' +0ms
  semantic-release:release-notes-generator currentTag: 'v4.2.1' +1ms
  semantic-release:release-notes-generator host: 'https://git.corp.domain.com' +0ms
  semantic-release:release-notes-generator host: 'https://git.corp.domain.com' +0ms
  semantic-release:release-notes-generator linkReferences: undefined +0ms
  semantic-release:release-notes-generator issue: 'issues' +0ms
  semantic-release:release-notes-generator commit: 'commit' +0ms
[9:13:22 PM] [semantic-release] › ✔  Completed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[9:13:22 PM] [semantic-release] › ℹ  Start step "prepare" of plugin "@semantic-release/npm"
[9:13:22 PM] [semantic-release] [@semantic-release/npm] › ℹ  Write version 4.2.1 to package.json in /home/circleci/project
v4.2.1
[9:13:23 PM] [semantic-release] › ✔  Completed step "prepare" of plugin "@semantic-release/npm"
[9:13:29 PM] [semantic-release] › ✔  Created tag v4.2.1
[9:13:29 PM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/npm"
[9:13:29 PM] [semantic-release] [@semantic-release/npm] › ℹ  Publishing version 4.2.1 to npm registry on dist-tag latest
npm notice 
npm notice 📦  @new/dummy-cci-release@4.2.1
npm notice === Tarball Contents === 
npm notice 170B  src/index.js          
npm notice 183B  src/index.test.js     
npm notice 467B  .releaserc.json       
npm notice 205B  src/avenger-names.json
npm notice 655B  package.json          
npm notice 242B  README.md             
npm notice 7.3kB .circleci/config.yml  
npm notice === Tarball Details === 
npm notice name:          @new/dummy-cci-release                  
npm notice version:       4.2.1                                   
npm notice package size:  3.1 kB                                  
npm notice unpacked size: 9.2 kB                                  
npm notice shasum:        cbbb84d3c760f7c999c875a95557c1f340ddda38
npm notice integrity:     sha512-F2XkwzXhOiKeF[...]0rPUGLDCt9Xjg==
npm notice total files:   7                                       
npm notice 
+ @new/dummy-cci-release@4.2.1
[9:13:30 PM] [semantic-release] [@semantic-release/npm] › ℹ  Published @new/dummy-cci-release@4.2.1 to dist-tag @latest on https://artifactory.corp.domain.com:443/artifactory/api/npm/npm-new-release-local/
[9:13:30 PM] [semantic-release] › ✔  Completed step "publish" of plugin "@semantic-release/npm"
[9:13:30 PM] [semantic-release] › ℹ  Start step "publish" of plugin "@semantic-release/github"
  semantic-release:github release object: {
  semantic-release:github   owner: 'new',
  semantic-release:github   repo: 'dummy-cci-release',
  semantic-release:github   tag_name: 'v4.2.1',
  semantic-release:github   name: 'v4.2.1',
  semantic-release:github   body: '## ' +
  semantic-release:github     '[4.2.1](https://git.corp.domain.com/new/dummy-cci-release/compare/v4.2.0...v4.2.1) ' +
  semantic-release:github     '(2020-01-14)\n\n\n\n',
  semantic-release:github   prerelease: false
  semantic-release:github } +0ms
[9:13:30 PM] [semantic-release] [@semantic-release/github] › ℹ  Published GitHub release: https://git.corp.domain.com/new/dummy-cci-release/releases/tag/v4.2.1
[9:13:30 PM] [semantic-release] › ✔  Completed step "publish" of plugin "@semantic-release/github"
[9:13:30 PM] [semantic-release] › ℹ  Start step "success" of plugin "@semantic-release/github"
  semantic-release:github found pull requests: [ 39, 40 ] +0ms
  semantic-release:github found issues via comments: [] +7ms
  semantic-release:github create comment: {
  semantic-release:github   owner: 'new',
  semantic-release:github   repo: 'dummy-cci-release',
  semantic-release:github   issue_number: 39,
  semantic-release:github   body: ':tada: This PR is included in version 4.2.1 :tada:\n\nThe ' +
  semantic-release:github     'release is available on:\n- `npm package (@latest dist-tag)`\n- ' +
  semantic-release:github     '[GitHub ' +
  semantic-release:github     'release](https://git.corp.domain.com/new/dummy-cci-release/releases/tag/v4.2.1)\n' +
  semantic-release:github     '\nYour ' +
  semantic-release:github     '**[semantic-release](https://github.com/semantic-release/semantic-release)** ' +
  semantic-release:github     'bot :package::rocket:'
  semantic-release:github } +0ms
  semantic-release:github create comment: {
  semantic-release:github   owner: 'new',
  semantic-release:github   repo: 'dummy-cci-release',
  semantic-release:github   issue_number: 40,
  semantic-release:github   body: ':tada: This PR is included in version 4.2.1 :tada:\n\nThe ' +
  semantic-release:github     'release is available on:\n- `npm package (@latest dist-tag)`\n- ' +
  semantic-release:github     '[GitHub ' +
  semantic-release:github     'release](https://git.corp.domain.com/new/dummy-cci-release/releases/tag/v4.2.1)\n' +
  semantic-release:github     '\nYour ' +
  semantic-release:github     '**[semantic-release](https://github.com/semantic-release/semantic-release)** ' +
  semantic-release:github     'bot :package::rocket:'
  semantic-release:github } +1ms
[9:13:35 PM] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #39: https://git.corp.domain.com/new/dummy-cci-release/pull/39#issuecomment-2142477
[9:13:38 PM] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #40: https://git.corp.domain.com/new/dummy-cci-release/pull/40#issuecomment-2142478
[9:13:41 PM] [semantic-release] [@semantic-release/github] › ℹ  Added labels [ 'released' ] to issue #39
[9:13:43 PM] [semantic-release] [@semantic-release/github] › ℹ  Added labels [ 'released' ] to issue #40
  semantic-release:github found semantic-release issues: [] +10s
[9:13:44 PM] [semantic-release] › ✔  Completed step "success" of plugin "@semantic-release/github"
[9:13:44 PM] [semantic-release] › ✔  Published release 4.2.1 on default channel

@pheenomenon
Copy link
Author

Reading the code at fc9b28a#diff-22b2e42b5e693db528f0afe8f5c4a6fcR26 and the behavior for micromatch.isMatch(), looks like the below rule could be tweaked. Trying it out to get rid of tag to * maybe..

{
        "tag": "*",
        "release": "patch"
}

@pvdlg
Copy link
Member

pvdlg commented Jan 14, 2020

"tag": "*" indicate to match commits with a tag field defined with any value. So commits will match only if you use a preset that defines a tag property to the parsed commit and if your commit are formatted such that there is something in that tag.
If you want to match all commits independently of their formatting then set your rule on subject or message instead of tag.

@pheenomenon
Copy link
Author

@pvdlg thank you again! that was it. Got it now. 🎉
Here is what I have in .releaserc.json . Still trying out few stuff, but have much better understanding now.

{
  "analyzeCommits": {
    "preset": "eslint",
    "releaseRules": [
      {
        "tag": "Breaking",
        "release": "major"
      },
      {
        "tag": "New",
        "release": "minor"
      },
      {
        "subject": "*",
        "release": "patch"
      },
      {
        "scope": "no-release",
        "release": false
      }
    ],
    "parserOpts": {
      "noteKeywords": [
        "BREAKING CHANGE",
        "BREAKING CHANGES"
      ]
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants