Skip to content

Commit 705c387

Browse files
committed
Populate Zenodo auto-doi exercise instructions
1 parent 9f1994e commit 705c387

File tree

4 files changed

+231
-1
lines changed

4 files changed

+231
-1
lines changed
140 KB
Loading

modules/05-sharing-and-publishing/index.md

Lines changed: 231 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,238 @@ We can automate the production of DOIs with GitHub and [Zenodo](https://zenodo.o
838838

839839
### 💪 Exercise E: Get a DOI for your published content on GitHub
840840

841-
TODO
841+
#### Create an ORCID
842+
843+
Visit the [ORCID registration page](https://orcid.org/register) and create an account.
844+
845+
Enter your **personal email** as your primary email.
846+
Be sure to also enter your institutional email as an additional email.
847+
You can more emails after you register.
848+
849+
850+
#### Sign up for Zenodo
851+
852+
Visit the [Zenodo signup page](https://zenodo.org/signup/) and sign up with either your
853+
GitHub account or ORCID.
854+
We recommend using GitHub, as you'll need to link your GitHub account either way.
855+
856+
857+
##### Link your GitHub account
858+
859+
If you didn't signup with GitHub, you'll need to link your GitHub account.
860+
861+
After you've signed in, click the username dropdown at the top-right of the Zenodo
862+
interface.
863+
864+
On the left panel, select "Linked accounts".
865+
866+
On the GitHub row, click "Connect".
867+
You may be prompted to log in, then you'll be prompted to accept some dialogs.
868+
869+
:::{important} 👀 You should notice...
870+
:class: simple
871+
:icon: false
872+
873+
Back in the Zenodo "Linked accounts" screen, a green checkmark will be
874+
displayed next to GitHub.
875+
:::
876+
877+
878+
879+
#### Enable auto-DOI for your repository on Zenodo
880+
881+
After you've signed in to Zenodo, click the username dropdown at the top-right of the
882+
Zenodo interface.
883+
884+
On the left panel, select "GitHub".
885+
886+
:::{important} 👀 You should notice...
887+
:class: simple
888+
:icon: false
889+
890+
...there is a large "Get started" display with a 3-step process you can follow to enable auto-DOI for a
891+
repository.
892+
893+
At the top right of this "Get started" box, there is a "Sync now" button.
894+
:::
895+
896+
Click "Sync now".
897+
It may take a moment to complete the sync.
898+
899+
:::{hint} Help, I received a `504` error!
900+
:class: dropdown
901+
902+
If you receive a `504` error,
903+
[this is common for users with large numbers of public repositories](https://github.com/zenodo/zenodo-rdm/issues/1118).
904+
Wait a few minutes and refresh the page; eventually your repository list will be updated
905+
:::
906+
907+
Find your repository in the list and flip the switch for that repository
908+
to "ON".
909+
910+
![](./zenodo-repository-enable.jpg)
911+
912+
913+
#### Create `CITATION.cff`
914+
915+
A `CITATION.cff` file is the project metadata that enables Zenodo to populate a DOI.
916+
917+
MyST can generate a `CITATION.cff` for you!
918+
But it needs to be told which documents to use to populate this metadata.
919+
920+
Edit `index.md` to add another export format of `"cff"`:
921+
922+
```{code} markdown
923+
:filename: index.md
924+
:linenos:
925+
:emphasize-lines: 14
926+
927+
---
928+
authors:
929+
- name: "Matt Fisher"
930+
affiliations:
931+
- "Schmidt Center for Data Science & Environment"
932+
- "University of California, Berkeley"
933+
934+
github: "mfisher87"
935+
orcid: "0000-0003-3260-5445"
936+
export:
937+
- format: "typst"
938+
template: "plain_typst_book"
939+
output: "paper.pdf"
940+
- format: "cff"
941+
---
942+
943+
# My document title
944+
```
945+
946+
Now we can build our `CITATION.cff` file with the command:
947+
948+
```bash
949+
myst build --cff
950+
```
951+
952+
:::{important} 👀 You should notice...
953+
:class: simple
954+
:icon: false
955+
956+
...the following output:
957+
958+
```
959+
📑 Exported CFF in 37 ms, copying to CITATION.cff
960+
```
961+
:::
962+
963+
As your project grows and changes, you can regenerate this file by repeating
964+
that command.
965+
966+
You can also edit your citation file by hand -- it's in the YAML format, which may be
967+
familiar to you now!
968+
Check out the
969+
[full CFF specification](https://citation-file-format.github.io/assets/pdf/cff-specifications-1.0.0.pdf)
970+
to see what kind of information you can populate!
971+
972+
973+
#### Create a GitHub release
974+
975+
Zenodo creates DOIs **only** when you create releases in GitHub.
976+
977+
Visit the URL for your GitHub repository's homepage.
978+
979+
Click the "Create a new release" button on the right sidebar.
980+
981+
![](./github-create-a-release.jpg)
982+
983+
Click the "Tag" dropdown and click "Create new tag".
984+
We'll use tags to create an ascending numerical sequence for our releases.
985+
For simplicity, let's enter the date in `YYYY.MM.DD` format, e.g. `2025.12.18`.
986+
987+
:::{hint} Versioning schemes
988+
:class: dropdown
989+
990+
There are many
991+
[versioning schemes](https://nesbitt.io/2024/06/24/from-zerover-to-semver-a-comprehensive-list-of-versioning-schemes-in-open-source.html)
992+
to choose from.
993+
The one we suggested above is called ["CalVer"](https://calver.org/) or "calendar versioning".
994+
995+
You may want to try an extremely common versioning scheme called
996+
["SemVer"](https://semver.org/) or "semantic versioning" enables embedding
997+
information about the implications of upgrading to any given version in the
998+
version number itself.
999+
:::
1000+
1001+
Give your release the title "Initial release".
1002+
1003+
You don't need to enter anything in the "Release notes" field, but we recommend
1004+
using the "Generate release notes" button as a starting place.
1005+
1006+
:::{hint} "Generate release notes" only generates one line of text!
1007+
:class: dropdown
1008+
1009+
This feature uses
1010+
[GitHub Pull Requests (PRs)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
1011+
to generate a list of changes.
1012+
If you don't use PRs, you will only see a "Changelog" link, this is normal.
1013+
:::
1014+
1015+
Finally, **click "Publish release"**.
1016+
1017+
Zenodo will automatically generate your DOI now.
1018+
1019+
1020+
#### Add a badge to your README
1021+
1022+
Zenodo also automatically generates a beautiful DOI "badge" you can display on
1023+
your repository's README or anywhere else on the web.
1024+
1025+
To use the badge, click the username dropdown at the top-right of the Zenodo
1026+
interface, and select "GitHub".
1027+
1028+
Locate your repository on the list of enabled repositories and click on the
1029+
blue DOI badge:
1030+
1031+
![](./zenodo-doi-badge.jpg)
1032+
1033+
Copy the "Markdown" code and paste it into a new `README.md` file in your repository:
1034+
1035+
```{code} markdown
1036+
:filename: README.md
1037+
:linenos:
1038+
:emphasize-lines: 1
1039+
1040+
[![DOI](https://zenodo.org/badge/1100194185.svg)](https://doi.org/10.5281/zenodo.17716242)
1041+
1042+
# My exercise from the AGU workshop "Open Source Geospatial Workflows in the Cloud"
1043+
```
1044+
1045+
:::{important} 👀 You should notice...
1046+
:class: simple
1047+
:icon: false
1048+
1049+
...your repository homepage renders your `README.md` file with a pretty blue badge at the top 🤩
1050+
1051+
Clicking the badge takes you to the Zenodo homepage for your DOI.
1052+
From here, you can generate citations in a variety of formats or download your archived repository as a Zip file.
1053+
:::
1054+
1055+
:::{hint} Writing a useful README
1056+
:class: dropdown
1057+
1058+
The README is the first thing that a user sees when they interact with your repository.
1059+
1060+
Check out
1061+
[The Turing Way's README guide](https://book.the-turing-way.org/project-design/pd-overview/project-repo/project-repo-readme/)
1062+
for some thoughts that may help you make your README more useful.
1063+
:::
8421064

8431065
#### 🧠 What do we know now?
8441066

8451067
TODO
1068+
1069+
1070+
## 🎉 Congratulations, you're done!
1071+
1072+
Great job finishing this module.
1073+
If you'd like continued support in applying these skills to your work, please join the
1074+
[MyST community on Discord](https://discord.mystmd.org/) and/or ask questions in the
1075+
[CryoCloud Slack](https://book.cryointhecloud.com/index-3#slack-account)!
24.2 KB
Loading
13 KB
Loading

0 commit comments

Comments
 (0)