Better understanding Composer registry

How gitlab create composer package to registry ?

I’m currently working on building several “module” to be usable throuhg “composer” cli.
In some of this module i have to build “assets” with node/npm and webpack.

For those tasks I used gitlab CI to :

  1. Create a build stage with node image. I can see “assets” built.
  2. Create a task to generate composer package.

I though, by using artifacts, i could create a package with freshly built assets.
But it seems that the package never embed thoses statics/built assets.
My question is :

How gitlab create composer package ?
Does he only git pull and “zip” the repository via composer.json ?
Is there any “guidelines” to setup a CI with build and publish package ?
Is there any manual “curl post” with already zipped package command to upload to gitlab package registry ?

My first idea is to build, then push to the repository and finally trigger the “curl” command to create the composer package has a workaround.

Thanks in advance !

PS: English is not my native language. Be kind :slight_smile: with me :smiley:

1 Like

Have you been able to resolve this problem by now?
I’m also having this problem and I did not quite get what I could do to get it solved.
One idea that I am investigating:

  1. CI job to build a ZIP
  2. Upload it as generic package to the package registry
  3. Somehow integrate it in my target project as composer artifact (which seems to only work locally)

I will post it here when I find a solution.

Hi @haynzz.
I did not find a “good” solution for the moment. I hope there might be a solution from Gitlab.
But !

The only “way” i could make it work is to setup a step which built all the artefacts. Then push it to the repository (With a tag) then launch a build from this “new” tag.

But i would find a more “dynamic” solution.

Hi @valentin-ed.
thanks for getting back.
What you mention is actually my backup plan.
I am also looking into post-install-scripts via composer. But it does not feel like an elegant solution. Since the target machine would need npm installed.
I also think gitlab should find a solution.
Do you think it makes sense that we open an issue for it?