Skip to content

Commit 23d800b

Browse files
committed
📝 Update HERMES workflow
1 parent 9b9d798 commit 23d800b

5 files changed

Lines changed: 96 additions & 11 deletions

File tree

225 KB
Loading

docs/productive/cite/hermes.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[harvest]
2+
from = [ "git", "cff" ]
3+
4+
[deposit]
5+
mapping = "invenio"
6+
target = "invenio"
7+
8+
[deposit.invenio]
9+
site_url = "https://sandbox.zenodo.org"
10+
access_right = "open"
11+
12+
[postprocess]
13+
execute = [ "config_record_id" ]

docs/productive/cite/software.rst

Lines changed: 81 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ others will hardly be able to cite your software directly if you send it to
1818
them as an email attachment. Even a download link is not really useful here. It
1919
is better to provide a `persistent identifier (PID)
2020
<https://en.wikipedia.org/wiki/Persistent_identifier>`_ to ensure the long-term
21-
availability of your software. Both `Zenodo <https://zenodo.org/>`_ and
21+
availability of your software. Both `Zenodo <https://zenodo.org/>`__ and
2222
`figshare <https://figshare.com/>`_ repositories accept source code including
2323
binaries and provide `Digital Object Identifiers (DOI)
2424
<https://en.wikipedia.org/wiki/Digital_object_identifier>`_ for them. The same
@@ -52,12 +52,14 @@ citation information for software.
5252
* `schema.json
5353
<https://github.com/citation-file-format/citation-file-format/blob/main/schema.json>`_
5454

55+
.. _zenodo:
56+
5557
Create a DOI with Zenodo
5658
------------------------
5759

58-
`Zenodo <https://zenodo.org/>`_ enables software to be
59-
archived and a DOI to be provided for it. In the following I will show which
60-
steps are required on the example of the Jupyter tutorial:
60+
`Zenodo <https://zenodo.org/>`__ enables software to be archived and a DOI to be
61+
provided for it. In the following I will show which steps are required on the
62+
example of the Jupyter tutorial:
6163

6264
#. If you haven’t already, `create an account on Zenodo
6365
<https://zenodo.org/signup/>`_, preferably with GitHub.
@@ -256,19 +258,87 @@ Alternatively, Git2PROV also provides a web server with:
256258
<http://ceur-ws.org/Vol-1035/iswc2013_demo_32.pdf>`_
257259
* `GitHub-Repository <https://github.com/IDLabResearch/Git2PROV>`_
258260

259-
hermes
261+
HERMES
260262
------
261263

262-
`hermes <https://project.software-metadata.pub>`_ simplifies the publication of
264+
`HERMES <https://project.software-metadata.pub>`_ simplifies the publication of
263265
research software by continuously retrieving existing metadata in :ref:`cff`,
264266
:ref:`codemeta` and :doc:Git <../git/index>`. Subsequently, the metadata is also
265267
compiled appropriately for `InvenioRDM
266268
<https://invenio-software.org/products/rdm/>`_ and `Dataverse
267269
<https://dataverse.org/>`_. Finally, :ref:`CITATION.cff <cff>` and
268270
:ref:`codemeta.json <codemeta>` are also updated for the publication
269-
repositories. You can find an example GitHub Action in
270-
`TEMPLATE_hermes_github_to_zenodo.yml
271-
<https://github.com/hermes-hmc/ci-templates/blob/main/TEMPLATE_hermes_github_to_zenodo.yml>`_.
271+
repositories.
272272

273-
.. seealso::
274-
* `GitHub <https://github.com/hermes-hmc/workflow>`_
273+
#. Add ``.hermes/`` to the :ref:`.gitignore <gitignore>` file
274+
#. Provide :ref:`CITATION.cff <cff>` file with additional metadata
275+
276+
.. important::
277+
Make sure ``license`` is defined in the :ref:`CITATION.cff <cff>` file;
278+
otherwise, your release will not be accepted as open access by the
279+
:ref:`Zenodo <zenodo>` sandbox.
280+
281+
#. Configure HERMES workflow
282+
283+
The HERMES workflow is configured in the file
284+
:doc:`/data-processing/serialisation-formats/toml/index`, where each step
285+
gets its own section.
286+
287+
If you want to configure HERMES to use the metadata from :doc:`Git
288+
<../git/index>` and :ref:`CITATION.cff <cff>`, and to file in the Zenodo sandbox built on InvenioRDM, the :file:`hermes.toml` file looks like this:
289+
290+
.. literalinclude:: hermes.toml
291+
:caption: hermes.toml
292+
:name: hermes.toml
293+
294+
#. Access token for Zenodo Sandbox
295+
296+
In order for GitHub Actions to publish your repository in the `Zenodo Sandbox
297+
<https://sandbox.zenodo.org/>`_, you need a personal access token. To do
298+
this, you need to log in to Zenodo Sandbox and then create a `personal access
299+
token
300+
<https://sandbox.zenodo.org/account/settings/applications/tokens/new/>`_ in
301+
your user profile with the name :samp:`HERMES workflow` and the scopes
302+
:guilabel:`deposit:actions` und :guilabel:`deposit:write`:
303+
304+
.. image:: zenodo-personal-access-token.png
305+
:alt: Zenodo: Neues persönliches Zugangstoken
306+
307+
#. Copy the newly created token to a new `GitHub secret
308+
<https://docs.github.com/de/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository>`_
309+
named :samp:`ZENODO_SANDBOX` in your repository: `Settings --> Secrets and
310+
Variables --> Actions --> New repository secret`:
311+
312+
.. image:: github-new-action-secret.png
313+
:alt: GitHub: Neues Action-Secret
314+
315+
#. Configure the GitHub action
316+
317+
The HERMES project provides templates for continuous integration in a special
318+
repository: `hermes-hmc/ci-templates
319+
<https://github.com/hermes-hmc/ci-templates>`_. Copy the template file
320+
`TEMPLATE_hermes_github_to_zenodo.yml
321+
<https://github.com/hermes-hmc/ci-templates/blob/main/TEMPLATE_hermes_github_to_zenodo.yml>`_
322+
into the :file:`.github/workflows/` directory of your repository and rename
323+
it, for example to :file:`hermes_github_to_zenodo.yml`.
324+
325+
Then you should go through the file and look for comments marked :samp:`#
326+
ADAPT`. Modify the file to suit your needs.
327+
328+
Finally, add the workflow file to version control and push it to the GitHub
329+
server:
330+
331+
.. code-block:: console
332+
333+
$ git add .github/workflows/hermes_github_to_zenodo.yml
334+
$ git commit -m ":construction_worker: GitHub action for automatic publication with HERMES"
335+
$ git push
336+
337+
#. GitHub actions should be allowed to create pull requests in your repository
338+
339+
The HERMES workflow will not publish metadata without your approval. Instead,
340+
it will create a pull request so that you can approve or change the metadata
341+
that is stored. To enable this, go to :menuselection:`Settings --> Actions
342+
--> General` in your repository and in the :guilabel:`Workflow permissions`
343+
section, enable :guilabel:`Allow GitHub Actions to create and approve pull
344+
requests`.
91.6 KB
Loading

docs/productive/git/install-config.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ increased if necessary, for example with:
298298
* `Git Credential Manager: authentication for everyone
299299
<https://github.blog/2022-04-07-git-credential-manager-authentication-for-everyone/>`_
300300

301+
.. _gitignore:
302+
301303
The ``.gitignore`` file
302304
~~~~~~~~~~~~~~~~~~~~~~~
303305

0 commit comments

Comments
 (0)