1

I already set the varaible,but it seems not work.

enter image description here

sementic log shows its was using @semantic-release/github,but actually my repo is in the gitlab, is that reason?By the way i have already install the @semantic-release/gitlab puglin

[semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/github"

other setting is here:

//.npmrc:

registry=https://registry.npmjs.org/

//gitlab.com/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN}

//gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}

releaserc.json:


{
  "branches": ["master"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/gitlab",
    "@semantic-release/npm",
    [
      "@semantic-release/git",
      {
        "assets": ["package.json"],
        "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
      }
    ]
  ]
}


陈子天
  • 21
  • 4

2 Answers2

0

My first guess would be that the releaserc.json you provided is in a different scope when you call semantic-release.

I base this on the fact you said in your question that semantic-release uses the @semantic-release/github plugin, which runs by default when no alternative configuration is provided to semantic-release.

You could try the following tutorial from GitLab to find where things turn south: https://docs.gitlab.com/ee/ci/examples/semantic-release.html

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
phn
  • 85
  • 6
  • 1
    So if releaserc file is in adifferent scope how can i fix it? I already read the tutorial but i found its gitlab-ci.yml example can't pass the cilint. – 陈子天 Aug 29 '21 at 05:34
  • I assume you are trying to publish a NodeJS application to NPM. So if that is the case you could add a releaserc.json and npmrc to your project root and commit it to your repo. That way you don’t need to set it up in gitlab-ci. This should mitigate the problem that semantic-release can’t find your configuration. – phn Aug 29 '21 at 07:09
  • I dont want to publish to npm... I just want the semanticrelease package to workwith gitlab – gota Oct 03 '22 at 10:58
0

In your quesstion you have specified the configuration file name as releaserc.json but it should be .releaserc.json.

Brimstedt
  • 3,020
  • 22
  • 32