Automatic publishing to zenodo with gitlab

So you want to set up an automated workflow to publish new releases of your software to zenodo. It is convenient to use the CITATION.cff file in the citation file format as the central source of all required metadata. We can utilize the CFF converter utility to convert the CFF file into a json file that we can give as input to gitlab2zenodo. As detailed in the documentation of gitlab2zenodo a zenodo account is a prerequisite for setting up a gitlab pipeline.

The zenodo json specifications details certain fields that are required for a valid deposition and the upload_type field is one of them. If we are dealing with source code it is natural to set this to

"upload_type": "software"

CFF 1.2 has a "type" field that can be quite directly mapped to the upload_type, but my merge request to support this feature is still in review.

Until then, the respective field has to be added by hand, or by some tools like jq, or python's json module.

Having done that we can proceed to create a new data set to zenodo with g2z-send:

example output

gitlab2zenodo recommends to use a so-called sandbox mode of zenodo. Note that as of today I was not able to use it since zenodo didn't accept any upload using that feature.

But everything worked as soon as I uploaded it to zenodo's main instance.

As you notice g2z-send gives you an id that you need to make into a gitlab variable called zenodo_record for future runs.

If you create that in the gitlab settings of your project, g2z-send will always update your existing publication.

Tags