Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Feb 26, 2025
2 parents b2033c9 + 8fe3dc4 commit f2357fd
Show file tree
Hide file tree
Showing 75 changed files with 4,493 additions and 1,044 deletions.
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/add-plugin-to-marketplace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# SPDX-FileCopyrightText: 2024 Helmholtz-Zentrum Dresden-Rossendorf
# SPDX-License-Identifier: CC-BY-SA-4.0
# SPDX-FileContributor: David Pape

name: "Add Plugin to Marketplace"
description: "I want to add a plugin to the Hermes plugin marketplace."
title: "[New Plugin]: "
labels: ["documentation"]

body:
- type: markdown
attributes:
value: |
Thank you for building a plugin for Hermes and sharing it with the community!
The [Hermes plugin marketplace](https://hermes.software-metadata.pub#plugins) is a curated list of plugins on our website that allows you to share plugins that you developed, and others to find them.
Via this issue template, you can send us the required information to add your plugin to the marketplace. Alternatively, you may file a pull request, adding the plugin to [`plugins.json`](https://github.com/softwarepub/hermes/tree/develop/docs/source/plugins.json) yourself.
- id: "name"
type: "input"
attributes:
label: "Name"
description: "The name of the plugin"
placeholder: "Foobar Harvesting and Quux Deposit Plugin"
validations:
required: true

- id: "author"
type: "input"
attributes:
label: "Author"
description: "The author of the plugin, usually a team or organization"
placeholder: "Team Quux at Fizzbuzz Institute"

- id: "description"
type: "textarea"
attributes:
label: "Description"
description: "A short description of your plugin"
placeholder: "Plugin for harvesting foobar files and uploading deposits to quux repo."

- id: "steps"
type: "dropdown"
attributes:
label: "Steps"
description: "Steps of the Hermes workflow targeted by your plugin"
multiple: true
options: ["harvest", "process", "curate", "deposit", "postprocess"]

- id: "harvested-files"
type: "input"
attributes:
label: "Harvested files"
description: "The types of files your plugin harvests (if it is a harvest plugin)"
placeholder: "foobar, foobar.yml, foobar.json"

- id: "repository-url"
type: "input"
attributes:
label: "Repository"
description: "The link to the repository where users can find and inspect the source code of your plugin"
placeholder: "https://git.example.com/quux/hermes-plugin-quux"

- id: "pypi-url"
type: "input"
attributes:
label: "PyPI URL"
description: "The link to your project on PyPI"
placeholder: "https://pypi.org/project/hermes-plugin-quux/"

- id: "comments"
type: "textarea"
attributes:
label: "Comments"
description: "Any additional comments you would like to add"
2 changes: 1 addition & 1 deletion .github/workflows/cffconvert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out a copy of the repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Check whether the citation metadata from CITATION.cff is valid
uses: citation-file-format/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
uses: fsfe/reuse-action@v5
31 changes: 0 additions & 31 deletions .github/workflows/hermes-zenodo-sandbox.yml

This file was deleted.

151 changes: 151 additions & 0 deletions .github/workflows/hermes-zenodo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# SPDX-FileCopyrightText: 2023 German Aerospace Center (DLR), Helmholtz-Zentrum Drseden-Rossendorf, Forschungszentrum Jülich
#
# SPDX-License-Identifier: CC0-1.0

# SPDX-FileContributor: Stephan Druskat

name: Software publication on Zenodo

on:
push:
tags:
- "*"

# NOTE: Do not delete the trigger on closed pull requests, the HERMES workflow needs this.
pull_request:
types:
- closed

jobs:
hermes-prepare:
name: Prepare Metadata for Curation
runs-on: ubuntu-latest
# This condition becomes much easier when we only react to push events on the release branch.
# We still need to exclude the merge commit push of the post processing PR

# ADAPT
# Depending on the event you react to in the 'on:' section above, you will need to adapt this
# to react on the specific events.
# NOTE: You will probably still need to keep the exclusion check for commit messages provided by the workflow ('hermes/'/'hermes/post').
if: >
github.event_name == 'push' && ! (
startsWith(github.ref_name, 'hermes/') ||
contains(github.event.head_commit.message, 'hermes/post')
)
permissions:
contents: write # Allow creation of new branches
pull-requests: write # Postprocessing should be able to create a pull request with changes

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install hermes hermes-plugin-python
- run: hermes harvest
- run: hermes process
- run: hermes curate

- run: |
# Cache current branch for PR close job
git branch --show-current > .hermes/curate/target_branch
# Shorten the SHA for the PR title
SHORT_SHA=$(echo "$GITHUB_SHA" | cut -c -8)
echo "SHORT_SHA=$SHORT_SHA" >> "$GITHUB_ENV"
# Create a curation branch
git switch -c "hermes/curate-$SHORT_SHA"
git push origin "hermes/curate-$SHORT_SHA"
# Explicitly add to-be-curated metadata (which is ignored via .gitignore!)
git add -f .hermes/curate
- uses: peter-evans/create-pull-request@v7
with:
base: hermes/curate-${{ env.SHORT_SHA }}
branch: hermes/curate-result-${{ env.SHORT_SHA }}
title: Metadata Curation for Commit ${{ env.SHORT_SHA }}
body: |
Please carefully review the attached metadata.
If you are satisfied with the result, you may merge this PR, which will trigger publication.
(Any temporary branches will be cleaned up.)
delete-branch: true

hermes-curate:
name: Publish Software with Curated Metadata
if: github.event.pull_request.merged == true && startsWith( github.base_ref , 'hermes/curate-')

runs-on: ubuntu-latest
permissions:
contents: write # Allow creation of new branches
pull-requests: write # Postprocessing should be able to create a pull request with changes

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install hermes

# ADAPT
# If you want to publish artifacts (e.g., a zipped snapshot of your repository),
# you can prepare this here.
- run: git archive --format zip HEAD src > hermes.zip

# Run the HERMES deposition and postprocessing steps.
# ADAPT
# 1. You need to have an authentication token for your target publication platform
# as a GitHub secret in your repository (in this example, this is called ZENODO_SANDBOX).
# 2. Adapt the files you want to deposit. In the example, showcase.zip and README.md are deposited alongside the metadata.
# 3. Check if you want to run with '--initial', as this may potentially create a completely new record (collection),
# rather than a new version of the same collection!
- run: hermes deposit --initial -O invenio_rdm.auth_token ${{ secrets.ZENODO }} --file hermes.zip --file README.md

# ADAPT
# Remove this command if you don't want to do any postprocessing
- run: hermes postprocess

# ADAPT
# If you don't want to run postprocessing, remove this complete section (next '-run' and 'uses: peter-evans/...' bullets).
#
# Note 1: We change the base branch here for the PR. This flow runs so far within the "curated-metadata-*" branch,
# but now we want to add the changes done by deposit and post processing to the branch that was initially
# meant to be published using HERMES.
# Note 2: The create-pull-request action will NOT inherit the commits we did in the previous job. It will only look at the
# changes within this local workspace we did *now*.
- run: echo "TARGET_BRANCH=$(cat .hermes/curate/target_branch)" >> "$GITHUB_ENV"
- uses: peter-evans/create-pull-request@v7
with:
branch: hermes/post-${{ github.run_id }}
base: ${{ env.TARGET_BRANCH }}
title: Review hermes post-processing results
body: |
This is an automated pull request created by HERMES post-processing.
Please carefully review the changes and finally merge them into your
# Delete all the curation branches
- run: |
for BRANCH in $(git ls-remote origin 'refs/heads/hermes/curate-*' | cut -f2 | cut -d'/' -f'3-'); do
git push origin --delete "$BRANCH"
done
# TODO: if: failure() --- delete the curation branches when the deposition failed


hermes-cleanup:
name: Cleanup aborted curation branches
if: github.event.pull_request.merged == false && startsWith( github.base_ref , 'hermes/curate-')

runs-on: ubuntu-latest
permissions:
contents: write # Allow creation of new branches
pull-requests: write # Postprocessing should be able to create a pull request with changes

steps:
- uses: actions/checkout@v4
# Delete all the curation branches
- run: |
for BRANCH in $(git ls-remote origin 'refs/heads/hermes/curate-*' | cut -f2 | cut -d'/' -f'3-'); do
git push origin --delete "$BRANCH"
done
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install pypa/build
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -54,7 +54,7 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,22 @@ jobs:
python-version: ["3.10"] # Ignore Python < 3.10, they are unsupported

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install --upgrade pip poetry
poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ./test/ ./src/ --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 ./test/ ./src/ --count --select=E9,F63,F7,F82 --show-source --statistics
# Stop build on errors
flake8 ./test/ ./src/ --count --statistics
poetry run flake8 ./test/ ./src/ --count --statistics
- name: Test with pytest
run: |
pip install -e .
pip install requests-mock
pytest ./test/
poetry install
poetry run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ dist/

# HERMES workflow specifics
.hermes/
hermes.log
25 changes: 17 additions & 8 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ title: hermes
message: >-
If you use this software, please cite it using the
metadata from this file.
version: "0.8.0"
version: 0.9.0
license: "Apache-2.0"
abstract: "Implementation of the HERMES workflow for FAIR software publication."
abstract: "Tool to automate software publication. Not stable yet."
type: software
authors:
- given-names: Michael
Expand All @@ -29,15 +29,10 @@ authors:
email: [email protected]
affiliation: German Aerospace Center (DLR)
orcid: 'https://orcid.org/0000-0003-4925-7248'
- given-names: Jeffrey
family-names: Kelling
email: [email protected]
affiliation: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
orcid: 'https://orcid.org/0000-0003-1761-2591'
- given-names: Oliver
family-names: Bertuch
email: [email protected]
affiliation: Forschungszentrum Jülich GmbH (FZJ)
affiliation: Forschungszentrum Jülich
orcid: 'https://orcid.org/0000-0002-2702-3419'
- given-names: Oliver
family-names: Knodel
Expand All @@ -49,3 +44,17 @@ authors:
email: [email protected]
affiliation: Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
orcid: 'https://orcid.org/0000-0002-3145-9880'
- given-names: Kernchen
family-names: Sophie
email: [email protected]
affiliation: German Aerospace Center (DLR)
orcid: 'https://orcid.org/0009-0005-4430-6743'
- given-names: Nitai
family-names: Heeb
email: [email protected]
affiliation: Forschungszentrum Jülich
orcid: 'https://orcid.org/0009-0001-8382-4923'
identifiers:
- type: doi
value: 10.5281/zenodo.13221384
description: Version 0.8.1b1
Loading

0 comments on commit f2357fd

Please sign in to comment.