Create a release, add binary asset to it and make the asset last

I managed to create an asset on gitlab ci, which is cool and easy, now it’s also easy to create a release object. but how can is, if i can, using the CI YAML connect the two ? are there undocumented YAML params i can pass on to the runner to attach the asset ?

Also i understand all assets are deleted after X time of existence, how can i, using the CI not the api, make them last so they will be properly available in the release ?

And last, if i want to remove the release or remove the asset, any way to do that from the gitlab ui ? anyway to do that using the api ?


I have the exact same problem.

I develop an PHP application and I want to archive all sources with composer dependencies in an archive as an artefact of my CI and then link it as asset of a release.

How is this possible ?

i just created an artifact an set it up for 3 years, yyou can set it up for 10 years if you want it forever… or kind of forever. there is an API to set it up for “never delete” but i’m not sure ALL the api works with the key provided by the CI and groups tokens are not available yet.

Another option you have is to use amazon AWS S3 and save the artifacts there.

To create the release by the way i gave up on the YAML and used the release docker image published by gitlab team, and it worked, it if will help you i can show you that part of my yaml.