How to publish to GitLab Registry?
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?
@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.
@oncet How did you resolve this? can you share your latest gitlab config?
@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.