Versioning Strategies

Assigning DOIs to GitLab Repositories

< >

Assigning DOIs to GitLab Repositories

GitLab does not natively support DOI creation, but services like Zenodo can assign DOIs by integrating with GitLab repositories. The process involves archiving a version of your code and registering it with Zenodo to obtain a persistent identifier.


Step 1: Create a release in GitLab and upload an archive (e.g., ZIP file) of the code.

  • Navigate to your repository on GitLab.
  • Go to “Releases” > “New Release”, tag it with a version number (e.g., v1.0), and attach the ZIP archive of your project.

Step 2: Use Zenodo’s API or manual process to register the archive and obtain a DOI.

  • Upload the ZIP file to Zenodo via its web interface or API.
  • Assign metadata (e.g., title, description, author) and generate a DOI for the release.
  • Copy the DOI provided by Zenodo (e.g., 10.5281/zenodo.1234567).
  • Add the DOI badge or link to your GitLab project’s README.md or wiki:
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1234567.svg)](https://doi.org/10.5281/zenodo.1234567)

Alternative: Using unofficial script to connect to Zenodo

If you want to automate the process of assigning DOIs to your GitLab releases, you can use the unofficial script gitlab2zenodo . This script helps you connect your GitLab repository with Zenodo, making DOI assignment easier and more reproducible.

Guide externally:

Sacha Beniamine: gitlab2zenodo

Note:

This script is unofficial and not maintained by GitLab or Zenodo.

Please review the script and its documentation for updates and security best practices.

Alternative: Using GitHub mirrors with Zenodo integration

If you prefer using official plugins, you can mirror your GitLab repository to GitHub and use the Zenodo integration available there. This allows you to create a DOI for your GitLab repository by leveraging GitHub’s DOI generation capabilities.

Guide externally:

Overview by Hamburg University of Technology In depth guide by Hamburg University of Technology

Source and Further Reading

This guide is based on the following source: