semver icon indicating copy to clipboard operation
semver copied to clipboard

How to publish to GitLab Registry?

Open runoncedev opened this issue 3 years ago • 3 comments

Using jscutlery/semver with Nx and trying to publish to GitLab registry using CI/CD.

I went through the main readme plus this one:

  • https://github.com/jscutlery/semver/blob/main/packages/semver/src/executors/gitlab/README.md

After several iterations this is my current .gitlab-ci.yml file contents:

stages:
  - release

release:
  stage: release
  image: node:16.13.2
  before_script:
    - git config --global user.name "$GITLAB_USER_NAME"
    - git config --global user.email "$GITLAB_USER_EMAIL"
    - git checkout $CI_COMMIT_REF_NAME
    - git remote set-url origin http://nx-poc:<my-token>@git.example.com/foo/nx-poc.git
  script:
    - npm install
    - npx nx affected --target=version --base=last-release --push

And this is the relevant section of project.json:

"version": {
  "executor": "@jscutlery/semver:version",
  "options": {
    "baseBranch": "main",
    "postTargets": ["component-library:gitlab"]
  }
},
"gitlab": {
  "executor": "@jscutlery/semver:gitlab",
  "options": {
    "tag": "${tag}",
    "description": "${notes}"
  }
}

Tags seems to be pushing fine but nothing is added to the GitLab registry, what I'm missing?

runoncedev avatar Sep 08 '22 15:09 runoncedev

@oncet Isn't gitlab registry more of a container registry, did you mean you gitlab releases? npx nx affected --target=version --base=last-release --push Should you be adding --postTargets ?

no good examples about it in documentation I suppose.

atma-alterego avatar Dec 06 '22 08:12 atma-alterego

@oncet How did you resolve this? can you share your latest gitlab config?

durgapavaniB avatar Jun 28 '23 18:06 durgapavaniB

@oncet How did you resolve this? can you share your latest gitlab config?

Sorry I don't remember and I no longer work with GitLab.

runoncedev avatar Jun 29 '23 20:06 runoncedev