Publishing Code

Using GitHub releases and Zenodo DOIs
to create citable code snapshots

Stephen Formel

The Data Patch

2025-01-29

Why publish code?

  • Increase reproducibility and FAIR-ness
  • Make life easier for future you
  • Enable reuse and extension
  • Get credit for software as a research output

The long view

  • Science outlives tools and platforms
  • Papers persist; links rot
  • Without snapshots, methods cannot be verified

GitHub is not an archive

  • Excellent for collaboration
  • Moving target
  • No preservation guarantee
  • Not designed for citation
  • owned by private corporation (Microsoft)

What is a code archive?

A code archive is:

  • Persistent with PID
  • Findable and citable
  • Immutable once published
  • Backed by long-term infrastructure

Zenodo (for code)

  • Generalist research repository
  • Free and widely used
  • Issues DOIs via DataCite
  • Integrates with GitHub releases
  • operated by CERN

GitHub + Zenodo model

  • GitHub: active development
  • Zenodo: frozen snapshots

GitHub is where code lives
Zenodo is where code is cited

Where will you use this?

  • Instrument development
  • Pipeline development
  • Analysis iteration

Versioning and DOIs

  • Each GitHub release creates a new Zenodo version
  • Each version gets its own DOI
  • One concept DOI always points to the latest version

Let’s Practice

Pre-work

  • Make a GitHub account

Step 1: Fork the Repository

  1. Go to the example repo on GitHub
  2. Click Fork (top right)
  3. You now have your own copy under your account

Step 2: Make a Change

  • Edit the README
  • Commit your changes with a meaningful message
  • Push to your fork

Step 3: Publish to Zenodo Sandbox

  1. Log in to Zenodo sandbox
  2. Activate the repository you forked
  3. Create a GitHub release (tag your commit)
  4. Zenodo generates a DOI for the release

Step 4: Make Additional Changes

  • Update code or documentation
  • Create a new release on GitHub
  • Observe new DOI generated by Zenodo

Step 5: Explore Examples

Look at successful uses of this mechanism:

Note to Steve - add screenshots of examples and reference at the beginning too. Maybe find examples of instruments, pipelines and analysis. Parallel slide ‘where wil you use this?’

Step 6: Reflection

  • Could you explain this to a collaborator?