Adding lines to gitlab-ci.yaml file in ReportingAPI project for automatic versioning
Description: This issue is trying to model the environment shown in this repository. For whatever reason, I cannot get this to work. When following directions laid out in the README.md
of the sample repository it worked for the frontend but not the backend or api repositories.
Theories on why it doesn't work
- Repositories are different in a non-obvious way. I think this is the most likely reason why semantic-release does not work. I believe this because a global GL_TOKEN environment variable is used for all repositories. I believe that if all repos were exactly the same this variable would work for all repos.
- Projects are set up differently. This is another possibility for why semantic-release does not work. For example, the frontend's
.gitlab-ci.yml
file is in the top level directory; for the backend it is in thesrc
folder. I don't think this would cause a problem, but it is always possible.
Specific problem for this issue: ENONPMTOKEN No npm token specified.
I am not sure why this error is occurring. As far as I know, the pipeline should use the global GL_TOKEN environment variable.
Possible solutions
- Create a duplicate repository. Obviously not the ideal solution, but if the duplicate repository works with the exact same project then it must be a repository issue
- Use a personal npm token. If your personal token works, it could lead to insights as to why the GL_TOKEN does not.
- Rework semantic-release config. Right now, most of the config is in
package.json
. I believe there are other ways to implement semantic-release, for example a.releaserc.json
file - Modify release branches/remote connections. Maybe there is a problem with the pipeline not detecting a release branch even though they are all named
main
Other remarks
- One pipeline passed semantic-release and I have no clue why. Subsequent pipelines failed, which makes it even more confusing.
- Don't work too much on this issue. I spent way too much time trying to get this to work and still have not found a solution. If you do work on this issue and are not able to find a solution, please put what you have learned in this description.
Edited by Ryan Trembley