I'm in the process of setting up semantic release for my NPM package to automate deployment with version updates. However, after migrating from an old repo/npm package to a new one, I'm facing issues with semantic versioning not creating a new release and displaying the error message:
The local branch main is behind the remote one, therefore a new version won't be published.
In the new repository, I have already tagged it with v1.0.0
which matches the only published version of the package so far. Additionally, I've removed the changelog.md file to ensure a fresh start.
My release configuration looks like this:
{
"branches": ["main"],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/github",
{
"assets": [
"CHANGELOG.md",
"dist/*",
"package.json"
]
}
],
[
"@semantic-release/git",
{
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
You can view the CI for this public package here: https://github.com/stretch0/use-feature/actions/runs/3862807130/jobs/6584602017
If you're interested in exploring more of the code, check out the repository here: https://github.com/stretch0/use-feature