megasanjay/upload-to-zenodo

A GitHub action to automatically push a release to Zenodo

https://github.com/megasanjay/upload-to-zenodo

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 7 committers (14.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.9%) to scientific vocabulary

Keywords from Contributors

interface fair hack standardization ubuntu sharing curation interpretability interaction meshing
Last synced: 7 months ago · JSON representation ·

Repository

A GitHub action to automatically push a release to Zenodo

Basic Info
  • Host: GitHub
  • Owner: megasanjay
  • License: apache-2.0
  • Language: JavaScript
  • Default Branch: main
  • Homepage:
  • Size: 1.18 MB
Statistics
  • Stars: 7
  • Watchers: 1
  • Forks: 4
  • Open Issues: 7
  • Releases: 19
Created almost 4 years ago · Last pushed 8 months ago
Metadata Files
Readme License Citation Codeowners Codemeta Zenodo

README.md

Upload a GitHub release to Zenodo

This is a Github action to update your codemeta.json, CITATION.cff, and .zenodo.json files with the release information and then upload your release to Zenodo.

This action uses the tag name of the release to update the version field in the metadata files. Be sure to use the correct tag name. Within your tag name, a valid semver version should be present.

When updated metadata files are added to your repository, the action will automatically send the new metadata files in its release. This will also mean that your GitHub release will not contain the updated metadata files. To avoid this, you can set the update_metadata_files option to false and add a .zenodo.json file.

Remember to remove the webhook from your repository before using this action. Otherwise, you will have two releases on Zenodo for every release on GitHub.

Currently, the following files and fields will be updated:

* `codemeta.json`:
    * `version`: The release version
    * `identifier`: The release identifier (Zenodo version specific doi)

* `CITATION.cff`:
    * `version`: The release version
    * `identifiers`: The release identifier (Zenodo version specific doi).
    This action assumes your old zenodo doi is the first item in the list.

* `.zenodo.json`:
    * `version`: The release version

* `docs.compatibility.json`
    * A new entry will be added to this file. This entry is meant for versioned Docusaurus projects
        * `docsVersion` - The new docs version
        * `appVersion` - The latest app version

Inputs

A list of all inputs to the action is as follows:

github_token - Required - The GitHub token used to authenticate with GitHub. If not present, the action will attempt to read the token from the GITHUB_TOKEN environment variable.

zenodo_token - Required - The Zenodo token used to authenticate with Zenodo.

zenodo_deposition_id - Required - The Zenodo deposition ID to upload the release to.

zenodo_publish - Optional - Whether to publish the release. Defaults to false.

zenodo_sandbox - Optional - Whether to use the Zenodo sandbox. Defaults to false.

committer_name - Optional - The name of the committer.

committer_email - Optional - The email of the committer.

commit_message - Optional - The commit message. Defaults to chore: update ${file_name} for Zenodo release. You can use the ${file_name} variable to refer to the metdata file name in the commit message.

update_metadata_files - Optional - Whether to update the metadata files. Defaults to true. This will also push the changes to GitHub.

codemeta_json - Optional - Whether a codemeta.json file exists in the repository and needs to be updated for the new release. Defaults to false.

citation_cff - Optional - Whether a CITATION.cff file exists in the repository and needs to be updated for the new release. Defaults to false.

zenodo_json - Optional - Whether a .zenodo.json file exists in the repository and needs to be updated for the new release. Defaults to false.

docs_compatibility_json - Optional - Whether a docs.compatibility.json file exists in the repository and needs to be updated for the new release. Defaults to false.

Outputs

doi - The Zenodo DOI of the release.

version - The version of the release.

Example usage

A sample action is shown below.

```yaml name: Release on Zenodo

on: release: types: [published]

jobs: upload-to-zenodo: runs-on: ubuntu-latest name: A job to update metadata and push a release to Zenodo

steps:
  # This step is not needed at the moment but I might decide to add more steps in the future
  - name: Set up Node.js
    uses: actions/setup-node@v3
    with:
      node-version: 16

  - name: Upload to Zenodo
    id: release
    uses: megasanjay/upload-to-zenodo@v2.0.1
    with:
      github_token: ${{ secrets.GITHUB_TOKEN }}
      zenodo_token: ${{ secrets.ZENODO_TOKEN }}
      zenodo_deposition_id: SOME_DEPOSITION_ID
      zenodo_publish: true
      zenodo_sandbox: false
      commit_message: 'chore: update ${file_name} for Zenodo release'
      update_metadata_files: true
      codemeta_json: true
      citation_cff: true
      zenodo_json: true

  # Get the doi from the `release` step
  - name: Get the output doi
    run: echo "The released doi was ${{ steps.release.outputs.doi }}"

```

Build and release instructions

To build and release a new version of the action, run the following commands:

```sh npm install npm run build

git commit -a -m "chore: release action v1.2.3" git tag -a -m "Action v1.2.3 release" v1.2.3 git push --follow-tags ```

PS

I originally built this to handle auto-deploying our Docusaurus documentation sites to Zenodo. This was my first GitHub action so I'm hoping to improve this soon. We have since created another tool that you might be interested in for deploying your research software to Zenodo. Codefair is a free and open source GitHub app that acts as your personal assistant when it comes to making your research software reusable and especially complying with the Findable, Accessible, Interoperable, Reusable (FAIR) Principles for Research Software (FAIR4RS Principles)

Owner

  • Name: Sanjay Soundarajan
  • Login: megasanjay
  • Kind: user
  • Location: San Diego, CA
  • Company: FAIR Data Innovations Hub (@fairdataihub)

A little bit of everything developer at @fairdataihub :)

Citation (CITATION.cff)

abstract: A GitHub action to automatically push a release to Zenodo
authors:
  - affiliation: FAIR Data Innovations Hub
    email: ssoundarajan@calmi2.org
    family-names: Soundarajan
    given-names: Sanjay
cff-version: 1.2.0
date-released: '2022-08-30'
keywords:
  - GitHub
license: Apache-2.0
message: If you use this software, please cite it as below.
repository-code: https://github.com/megasanjay/upload-to-zenodo
title: Upload to Zenodo
type: software
version: 2.0.1
identifiers:
  - description: DOI for this application's record on Zenodo
    type: doi
    value: https://doi.org/10.5281/zenodo.7036310

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "license": "https://spdx.org/licenses/Apache-2.0",
  "codeRepository": "https://github.com/megasanjay/upload-to-zenodo",
  "dateCreated": "2022-06-07",
  "datePublished": "2022-06-07",
  "dateModified": "2022-08-30",
  "issueTracker": "https://github.com/megasanjay/upload-to-zenodo/issues",
  "name": "Upload to Zenodo",
  "version": "2.0.1",
  "description": "A GitHub action to automatically push a release to Zenodo",
  "applicationCategory": "Scientific",
  "keywords": [
    "GitHub"
  ],
  "programmingLanguage": [
    "JavaScript"
  ],
  "operatingSystem": [
    "Windows 11",
    "Big Sur (macOS 11)",
    "Ubuntu"
  ],
  "author": [
    {
      "@type": "Person",
      "givenName": "Sanjay",
      "familyName": "Soundarajan",
      "email": "ssoundarajan@calmi2.org",
      "affiliation": {
        "@type": "Organization",
        "name": "FAIR Data Innovations Hub"
      }
    }
  ],
  "identifier": "https://doi.org/10.5281/zenodo.7036310"
}

GitHub Events

Total
  • Issues event: 7
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 18
  • Push event: 11
  • Pull request review event: 4
  • Pull request event: 7
  • Fork event: 1
  • Create event: 3
Last Year
  • Issues event: 7
  • Watch event: 1
  • Delete event: 3
  • Issue comment event: 18
  • Push event: 11
  • Pull request review event: 4
  • Pull request event: 7
  • Fork event: 1
  • Create event: 3

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 113
  • Total Committers: 7
  • Avg Commits per committer: 16.143
  • Development Distribution Score (DDS): 0.752
Past Year
  • Commits: 14
  • Committers: 4
  • Avg Commits per committer: 3.5
  • Development Distribution Score (DDS): 0.429
Top Committers
Name Email Commits
renovate[bot] 2****] 28
github-actions[bot] 4****] 27
Lint Action l****n@s****m 18
Sanjay Soundarajan s****4@m****u 18
Sanjay Soundarajan s****6@l****m 13
dependabot[bot] 4****] 8
Paula Kammler p****a@z****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 5
  • Total pull requests: 57
  • Average time to close issues: 5 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 5
  • Total pull request authors: 4
  • Average comments per issue: 3.8
  • Average comments per pull request: 0.18
  • Merged pull requests: 37
  • Bot issues: 1
  • Bot pull requests: 56
Past Year
  • Issues: 3
  • Pull requests: 7
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 19 days
  • Issue authors: 3
  • Pull request authors: 3
  • Average comments per issue: 2.67
  • Average comments per pull request: 0.86
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 6
Top Authors
Issue Authors
  • HeinrichAD (1)
  • renovate[bot] (1)
  • alexlancaster (1)
  • megasanjay (1)
  • codingpaula (1)
Pull Request Authors
  • renovate[bot] (51)
  • dependabot[bot] (15)
  • depfu[bot] (3)
  • codingpaula (2)
Top Labels
Issue Labels
no-issue-activity (3)
Pull Request Labels
type: dependencies (51) dependencies (15) depfu (3)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 3
  • Total versions: 20
github actions: megasanjay/upload-to-zenodo

GitHub action to upload a release to Zenodo with the relevant metadata

  • License: apache-2.0
  • Latest release: v2.0.1
    published over 3 years ago
  • Versions: 20
  • Dependent Packages: 0
  • Dependent Repositories: 3
Rankings
Dependent packages count: 0.0%
Dependent repos count: 18.1%
Average: 22.1%
Stargazers count: 34.9%
Forks count: 35.3%
Last synced: 8 months ago

Dependencies

.github/workflows/check-misspellings.yml actions
  • actions/checkout v3 composite
  • peter-evans/create-pull-request main composite
  • sobolevn/misspell-fixer-action master composite
.github/workflows/lint-check.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • wearerequired/lint-action v2 composite
.github/workflows/main.yml actions
  • actions/setup-node v3 composite
  • megasanjay/upload-to-zenodo v2.0.1 composite
.github/workflows/stale.yml actions
  • actions/stale v5 composite
action.yml actions
  • dist/index.js node16 javascript
package-lock.json npm
  • 431 dependencies
package.json npm
  • @rollup/plugin-commonjs 22.0.2 development
  • @rollup/plugin-json 4.1.0 development
  • @rollup/plugin-node-resolve 13.3.0 development
  • @vercel/ncc 0.34.0 development
  • builtin-modules 3.3.0 development
  • dotenv 16.0.1 development
  • eslint 8.22.0 development
  • jest 28.1.3 development
  • prettier 2.7.1 development
  • rollup-plugin-esbuild 4.9.3 development
  • rollup-plugin-terser 7.0.2 development
  • @actions/core ^1.8.2
  • @actions/github ^5.0.3
  • axios ^0.27.2
  • dayjs ^1.11.5
  • js-yaml ^4.1.0
  • lodash ^4.17.21
  • mime-types ^2.1.35
  • semver ^7.3.7