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

Config not recognised #98

Open
balazsorban44 opened this issue Mar 10, 2020 · 6 comments
Open

Config not recognised #98

balazsorban44 opened this issue Mar 10, 2020 · 6 comments

Comments

@balazsorban44
Copy link

balazsorban44 commented Mar 10, 2020

I have the following config in .releaserc

{
  "branches": [
    "master",
    { "name": "develop", "prerelease": true }
  ],
  "plugins": [
    ["@semantic-release/commit-analyzer", {
      "preset": "conventionalcommits"
    }],
    ["@semantic-release/release-notes-generator", {
      "preset": "conventionalcommits",
      "presetConfig": {
        "types": [
          { "type": "feat", "section": "Features ✨", "hidden": false },
          { "type": "fix", "section": "Bug Fixes 🐛", "hidden": false },
          { "type": "chore", "section": "Chore 🔧", "hidden": false },
          { "type": "docs", "section": "Documentation 📚", "hidden": false },
          { "type": "style", "section": "Style 💄", "hidden": false },
          { "type": "refactor", "section": "Refactor ♻", "hidden": false },
          { "type": "perf", "section": "Performance 🏇", "hidden": false },
          { "type": "test", "section": "Testing ✅", "hidden": false },
          { "type": "build", "section": "Build 👷", "hidden": false }
        ]
      }
    }],
    ["@semantic-release/changelog", {
      "changelogFile": "CHANGELOG.md"
    }],
    ["@semantic-release/git", {
      "assets": ["CHANGELOG.md"]
    }]
  ]
}

When running the task on my branch develop, I get the following result:
image

Here is the config in the task, pointing to .releaserc
image

Running npx semantic-release --no-ci --dry-run locally on develop works fine, and shows the intended output.

my package.json contains:

"devDependencies": {
  "@semantic-release/changelog": "^5.0.0",
  "@semantic-release/commit-analyzer": "^8.0.1",
  "@semantic-release/git": "^9.0.0",
  "@semantic-release/release-notes-generator": "^9.0.1",
  "conventional-changelog-conventionalcommits": "^4.2.3",
  "semantic-release": "^17.0.4"
}

So I also don't get the warning:
npm WARN @semantic-release/[email protected] requires a peer of semantic-release@>=16.0.0 <18.0.0 but none is installed. You must install peer dependencies yourself.

UPDATE: After looking at the source code, I suspect this is a not yet implemented feature, as config.branches is never read anywhere. I may have a look at it, and see if I can do something about it. Although, I am no expert in semantic-release

UPDATE 2: I suspect this is due to "semantic-release": "^15.13.24" in freestyle. Looks like there was a change in how branches are handled after v16.0.0

@DanielHabenicht
Copy link
Owner

Yep you are right. I am still thinking about how to handle the update from one major version to another.

I think I will go forward with a v1 release an will upgrade semantic release to 16.

@balazsorban44
Copy link
Author

I suggest going straight for 17 then. The breaking change was the requirement for
Node.js >= 10.18

@DanielHabenicht
Copy link
Owner

DanielHabenicht commented Mar 12, 2020

I will release a 1.0 version at the end of this week.
It will add a Version Overwrite field in the "advanced" section
image

You can start using it right now, I updated the current task version (you just have to fill in @semantic-release/semantic-release@17 to use the latest version as the default is still 15)

The setting will also be available in 1.0.0 and future versions. But the default value might get raised from one task version to the other. (so in 1.0 it will be 17)

@DanielHabenicht
Copy link
Owner

Ok seems like there was an API change in between the versions so that an error will be thrown. I will investigate

@DanielHabenicht
Copy link
Owner

Nevermind, it works...

@DanielHabenicht
Copy link
Owner

DanielHabenicht commented Mar 12, 2020

In order to run your configuration you have to add additional packages (such as conventional-changelog-conventionalcommits to the advanced section aswell (each on a new line)

Like this: https://dev.azure.com/DanielHabenicht/test/_build/results?buildId=3219&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a&t=275f1d19-1bd8-5591-b06b-07d489ea915a

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