简体   繁体   中英

Semantic-release not creating new version for package

I have an NPM package I am trying to set up semantic release for so it will automatically deploy with a version bump.

I recently migrated from an old repo / npm package to a new one and since doing so semantic version wont create a new release for me and just says:

The local branch main is behind the remote one, therefore a new version won't be published.

I have created the v1.0.0 tag in the new repo and that matches the only published version of the package so far.

I have removed the changelog.md so it should start fresh.

My release config is like so:

{
  "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}"
      }
    ]
  ]
}

It's a public package so you can see the CI for yourself: https://github.com/stretch0/use-feature/actions/runs/3862807130/jobs/6584602017

Repo is here if you'd like to see the rest of the code: https://github.com/stretch0/use-feature

You can check the tags on the remote:

git ls-remote --tags origin

Then on your local repo:

git tag

1- To fetch all tags from the remote:

git fetch --tags

2- To push tags to the remote

git push --follow-tags

Step 1 should be enough. If it's not, step 2 may help. If it's not, run these 2 steps from your runner directory against the generated repository (ie actions-runner/_work/{reponame}/).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM