Add build artifact support for the composer package registry
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Hi!
It would be nice (in my opinion this is kind of a must-have) if i could add build artifacts to the composer package registry. In many cases i have PHP code, that will also bring frontend-resources that need compiling/compressing. I would like to add pipelines to have the dist packages contain compiled CSS instead of Sass, "transpiled" JavaScript code instead of typescript or latest ecma source code etc. There are other use-cases as well... And i don't like the idea of adding those files to the VCS.
Having a way of attaching build artifacts to git references so gitlab can include them in the resulting zip archive would be AWESOME.
Something like this could do the job i guess:
lets assume this is a working ci script
npm run-script build-assets assets.tar.gz
curl --header "Job-Token: $CI_JOB_TOKEN" --data branch=$CI_COMMIT_BRANCH "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/composer"
curl -X PUT --header "Job-Token: $CI_JOB_TOKEN" --upload-file=assets.tar.gz --data=revision=${CI_COMMIT_SHA}&extract "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/composer"
this is just a dummy example, there is for sure a better way to do this.
Best regards, Philipp