Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a task page to publish to Zenodo from GitLab #178

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
6 changes: 4 additions & 2 deletions _data/sidebars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ subitems:
url: /codemeta
- title: Licensing software
url: /licensing_software
- title: Obtaining a DOI for software
url: /zenodo_doi
- title: Publishing software from GitHub to Zenodo
vuillaut marked this conversation as resolved.
Show resolved Hide resolved
url: /github_zenodo
- title: Publishing software from GitLab to Zenodo
url: /gitlab_zenodo
- title: Reproducible virtual software development environments
url: /virtual_dev_environments
- title: Testing code
Expand Down
4 changes: 2 additions & 2 deletions pages/your_tasks/codemeta.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Writing a CodeMeta file
description: What is CodeMeta and how to write a CodeMeta file for your software
contributors: ["Daniel Garijo"]
page_id: codemeta
related_pages: [zenodo_doi]
related_pages: [github_zenodo]
---
## What is CodeMeta?
[CodeMeta](https://codemeta.github.io/terms/) is a community standard for interchanging software metadata records. It consists on a set of properties that extend [Schema.org](https://schema.org) (a popular vocabulary designed to describe Digital Objects on the Web) with software-specific metadata (e.g., maintainer, build instructions, software documentation, etc.)
Expand All @@ -12,7 +12,7 @@ related_pages: [zenodo_doi]

### Description <!-- do not delete this heading and write your text below it -->

By adding a `codemeta.json` file in your root source code repository, you will ease metadata propagation between different archival infrastructures. For example, when [obtaining DOIs for your code releases](https://everse.software/RSQKit/zenodo_doi), you won't need to fill in the corresponding software metadata again. CodeMeta is recognised and used by major code repositories and registries like [Zenodo](https://zenodo.org/) ([Invenio RDM](https://inveniosoftware.org/products/rdm/)) and [Software Heritage](https://www.softwareheritage.org/).
By adding a `codemeta.json` file in your root source code repository, you will ease metadata propagation between different archival infrastructures. For example, when [obtaining DOIs for your code releases](https://everse.software/RSQKit/github_zenodo), you won't need to fill in the corresponding software metadata again. CodeMeta is recognised and used by major code repositories and registries like [Zenodo](https://zenodo.org/) ([Invenio RDM](https://inveniosoftware.org/products/rdm/)) and [Software Heritage](https://www.softwareheritage.org/).

But how to create a `codemeta.json` file?

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Obtaining a DOI for software
description: How to obtain a DOI via Zenodo for your code releases
contributors: ["Shoaib Sufi", "Daniel Garijo"]
page_id: zenodo_doi
related_pages: []
title: Publishing software from GitHub to Zenodo
vuillaut marked this conversation as resolved.
Show resolved Hide resolved
description: How to obtain a DOI via Zenodo for your code releases on GitHub
contributors: ["Shoaib Sufi", "Daniel Garijo", "Thomas Vuillaume"]
page_id: github_zenodo
related_pages: [gitlab_zenodo, releasing_code]
---
## How can I get a Digital Object Identifier (DOI) for my code release?
## How can I get a Digital Object Identifier (DOI) for my code release on GitHub?

### Description
Obtaining a DOI (a type of persistent identifier) for your software has become [increasingly popular][datacite-doi-software] to indicate others how to cite your software (either in a publication or as an independent way of referring to your software versions). In this document we describe how to obtain a DOI to refer to your software releases.
Expand Down
78 changes: 78 additions & 0 deletions pages/your_tasks/gitlab_zenodo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: Publishing software from GitLab to Zenodo
search_exclude: true
description: How to obtain a DOI via Zenodo for your code releases on GitLab
contributors: ["Thomas Vuillaume"]
page_id: gitlab_to_zenodo
related_pages: [releasing_code, github_zenodo, codemeta]
keywords: [zenodo, gitlab, code release]
# More information on which page id you can use can be found at https://rdmkit.elixir-europe.org/website_overview
---
<!-- Please take in mind our style guide https://rdmkit.elixir-europe.org/style_guide when writing the content of this page. -->


## How can I get a Digital Object Identifier (DOI) for my code release on GitLab?

### Description

Publishing your code to Zenodo is a valuable practice that enhances the visibility, citability, and long-term preservation of your research software. By linking your code repository to Zenodo, you can:

1. Obtain a Digital Object Identifier (DOI) for your software, making it easier to cite and track.
2. Ensure long-term preservation of your code, even if the original repository becomes unavailable.
3. Increase the discoverability of your software through Zenodo's search functionality and metadata.
4. Comply with funding agency requirements for open science and data sharing.
5. Provide a stable, versioned archive of your software for reproducibility purposes.

In this document, we describe how to automatically archive a snapshot of your code repository on Zenodo whenever you create a new release on GitLab.

### Considerations

* You use a GitLab instance (either on gitlab.com or self-hosted) as your software repository
* You make software releases (e.g. using [semantic versioning][semantic-versioning])
* You use or are happy to make an account on the [Zenodo][zenodo] archive
* You would like to archive your code on Zenodo and obtain a DOI for each software release that people can use to cite your work
* You can provide metadata for your software in a `.zenodo.json` file or a `codemeta.json` file in the root of your repository to specify the metadata for your Zenodo deposit.
* Your GitLab repository can run CI/CD pipelines.

### Solutions

* Provide software metadata in a `.zenodo.json` or `codemeta.json` file.
* Create a `.zenodo.json` file in the root directory of your repository following the [Zenodo's metadata schema](https://developers.zenodo.org/#metadata).
vuillaut marked this conversation as resolved.
Show resolved Hide resolved
* Use the [Zenodo's sandbox](https://sandbox.zenodo.org/) to test your metadata.

* Get a [Zenodo token](https://zenodo.org/account/settings/applications/tokens/new/) with publishing rights (`deposit:actions` and `deposit:write` scopes).

* Add the [eossr](https://escape-ossr.gitlab.io/eossr/gitlab_to_zenodo.html) or the [gitlab2zenodo](https://gitlab.com/sbeniamine/gitlab2zenodo) libraries in your [GitLab-CI pipeline](https://docs.gitlab.com/ee/ci/yaml/) to automatically archive your code on Zenodo whenever you create a new release.

* [Create a GitLab release](https://everse.software/RSQKit/releasing_code) in your repository.
* Go to your repository
* Click on releases and then on New release
* Use the same version number as specified in your metadata (e.g. `1.0.0`).
* Add release notes
* Click on Create release

* The CI pipeline will automatically push your code on Zenodo.

* Get the DOI:
* After the GitLab release, go to Zenodo, where you will see your repository archived with a DOI assigned to it. Your badge is available in "Details":

![Badge in Zenodo](../../images/badge_zenodo.png)

* You may copy the badge in your README file:
* Now you can add the Zenodo badge in your GitLab repository. Click on the blue DOI and copy the markdown in your README. It will show as follows:

![Badge in your repository](../../images/badge_in_repo.png)

## Tools and resources

* Tools: [GitLab][gitlab], [Zenodo][zenodo], [eossr](https://escape-ossr.gitlab.io/eossr/), [gitlab2zenodo](https://gitlab.com/sbeniamine/gitlab2zenodo)
vuillaut marked this conversation as resolved.
Show resolved Hide resolved

## References

[calver]: (https://calver.org/)
[datacite-doi-software]: (https://datacite.org/blog/doi-registrations-software/)
[doi]: (https://www.doi.org/)
[semantic-versioning]: (https://semver.org/)
[what-are-pids]: (https://support.orcid.org/hc/en-us/articles/360006971013-What-are-persistent-identifiers-PIDs)
[zenodo]: (https://zenodo.org/)
[gitlab]: (https://gitlab.com/)
Loading