---
title: "Setting up the integration between GitHub, Zenodo and ORCID"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Setting up the integration between GitHub, Zenodo and ORCID}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
bibliography: references.bib
---

```{r setup, include = FALSE}
library(knitr)
opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

## What is [Zenodo](https://zenodo.org)?

Built and developed by researchers, to ensure that everyone can join in Open Science.

The OpenAIRE project, in the vanguard of the open access and open data movements in Europe was commissioned by the EC to support their nascent Open Data policy by providing a catch-all repository for EC funded research.
CERN, an OpenAIRE partner and pioneer in open source, open access and open data, provided this capability and Zenodo was launched in May 2013 [@zenodo].

In support of its research programme CERN has developed tools for Big Data management and extended Digital Library capabilities for Open Data.
Through Zenodo these Big Science tools could be effectively shared with the long-tail of research.

Publishing the package code through Zenodo has several benefits.

- The code is archived free of charge.
- The code remains publicly available, even if the GitHub repository is removed.
- The code gets a DOI, making it easier to cite the code and track the citations.
  Every release gets its own release and there is a dedicated DOI which always points at the latest release.
  This gives the user a choice between citing the code in general or a specific version.

## What is [ORCID](https://orcid.org)?

ORCID, which stands for Open Researcher and Contributor ID, is a global, not-for-profit organization sustained by fees from their member organizations.
They are community-built and governed by a [Board of Directors](https://info.orcid.org/orcid-board/) representative of their membership with wide stakeholder representation.
ORCID is supported by a dedicated and knowledgeable [professional staff](https://info.orcid.org/orcid-team/).

Individual researchers are the heart of everything ORCID does and will always have access to their records and data for free.
If you don’t already have an ORCID iD, [register for one today](https://orcid.org/register)!
Researchers can identify themselves with this ORCID iD in their publications.
This solves potential ambiguity dues to several persons with the same name or different spellings of a researchers name.

ORCID provides researchers an easy way to publish a list of publication on their ORCID profile.
The researcher can manually add publications to this profile.
ORCID has links with several data providers (e.g. publishers, Zenodo).
The researchers can setup ORCID to add new publications automatically to their profile.
This makes it easier to maintain an updated list of publications.

## Why integrate Zenodo and ORCID with GitHub?

Setting up the integration has the benefit that a new package version automatically gets a unique DOI and is added to your ORCID profile.

### Setup ORCID

#### Once

1. Create an account at https://orcid.org
1. Go to [DataCite](https://profiles.datacite.org/sign_in) and select "Sign in".
1. Select "Sign in with Globus", then "Sign in with ORCID iD".
1. Authorise access to Globus Auth.

### Setup Zenodo 

#### Once

1. Create an account using your ORCID at https://zenodo.org/signup/

#### Once per repository

1. Log-in to [Zenodo](https://zenodo.org).
1. Go the to drop-down box associated to your account (top right) and choose GitHub.
1. Find the repository in the list of repositories.
  Use the "Sync now" button if you can't find the repository.
  Note that you can only use public repositories.
1. Flip the switch of the repository to "On".

### What happens next?

1. Make sure that you've set-up your code as a package with `checklist` support.
  See `vignette("getting_started", package = "checklist")` on how to do that.
1. Add the ORCID of all contributors to the `DESCRIPTION`.
1. Pushing new commits to GitHub triggers a GitHub action that runs `check_package()`.
  This makes sure that the citation information in `CITATION`, `CITATION.cff` and `.zenodo.json` are up to date.
  Zenodo uses the latter as meta data for the new DOI.
1. Merging a pull request to the main branch will trigger a GitHub Action workflow that adds a new tag with the version number.
  This makes that version of the package installable with `remotes::install_github("organisation/package@tag")` (replace _organisation_, _package_ and _tag_ with the appropriate values).
  The tag is "v" followed by the version number (e.g. `v0.5.2`).
1. Adding the tag triggers another GitHub Action workflow that creates a new release.
  The relevant content of the `NEWS.md` becomes the description of the release.
1. Zenodo detects the new release, creates a DOI and publishes it.
1. Zenodo passes the citation metadata to ORCID for all contributors with an ORCID listed in `DESCRIPTION`.
  ORCID adds the publication information to the users which have added the DataCite integration.
