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: