Skip to content

Release 0.0.0 Curation Report #8

Release 0.0.0 Curation Report

Release 0.0.0 Curation Report #8

Workflow file for this run

# SPDX-FileCopyrightText: 2023 German Aerospace Center (DLR), Forschungszentrum Jülich, Helmholtz-Zentrum Dresden-Rossendorf
#
# SPDX-License-Identifier: CC0-1.0
name: Software Publication
on:
# This trigger on branches being pushed starts the HERMES pipeline.
push:
branches:
- main
issue_comment:
types: [created]
jobs:
hermes-prepare:
name: Prepare Metadata for Curation
runs-on: ubuntu-latest
# Only run on push events
if: github.event_name == 'push'
permissions:
contents: read
issues: write # Allow creating new issues with the reports from Software CaRD
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
# For now, skip using hermes - we're just testing CI here
#- run: pip install hermes
#- run: pip install git+https://github.com/softwarepub/hermes-plugin-git
#- run: hermes harvest
#- run: hermes process
# This is where we will run the Software CaRD plugin (later)
# - run: hermes curate
# Create a stub report
- run: |
mkdir -p .hermes/curate
echo '{"test": "foobar"}' > ./.hermes/curate/report
# Upload artifact (there are no real file attachments for issues and the max length may impose problems later, so we can't just use a <details> tag)
- id: upload-report
uses: actions/upload-artifact@v6
with:
name: softwarecard-report
path: ./.hermes/curate/*
if-no-files-found: 'error'
retention-days: 90
- run: 'echo Report artifact accessible at ${{ steps.upload-report.outputs.artifact-url }}'
- run: |
echo 'This is a stub message for a future Software CaRD report.' | tee -a ./report.md
echo 'View rendered version in the [Software CaRD SPA](https://softwarepub.github.io/software-card/index.html?type=github&repoUrl=${{ github.repositoryUrl }}&artifactUrl=${{ steps.upload-report.outputs.artifact-url }})' | tee -a ./report.md
echo '' | tee -a ./report.md
echo 'Created by hermes in [action run no. ${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})' | tee -a ./report.md
echo 'Find report artifact at [here](${{ steps.upload-report.outputs.artifact-url }})' | tee -a ./report.md
# Now create an issue and add the Software CaRD report
- name: Create Issue From File
uses: peter-evans/create-issue-from-file@v6
with:
title: Release 0.0.0 Curation Report
content-filepath: ./report.md
#labels: |
# report
# automated issue
- run: 'echo Created report in issue #${{ steps.create-report-issue.outputs.issue-number }}'
hermes-publish:
name: Publish after curation accepted
runs-on: ubuntu-latest
# The bit about who may run this job may be better put into steps, so we can extract from some configuration.
# The goal: only react to comments from curators!
if: >
github.event_name == 'issue_comment' &&
github.event.comment.author_association == 'MEMBER' &&
contains(github.event.comment.body, '/hermes publish')
steps:
- run: echo 'Curation was successful. Publishing now.'
# TODO: We need to figure out what should be checked out here!
# Ideas: extract from comment? find issue and extract from artifact?
# Caveats: make sure this is not an old issue and the artifact is still there...
#- uses: actions/checkout@v6
#- uses: actions/setup-python@v6
# with:
# python-version: '3.12'
# For now, skip using hermes - we're just testing CI here
#- run: pip install hermes
#- run: pip install git+https://github.com/softwarepub/hermes-plugin-git
# - run: hermes deposit
# - run: hermes post-process
# TODO: it would probably be a good idea to close the curation issue here. Maybe some other cleanup, too?
hermes-cleanup:
name: Cleanup after curation rejected
runs-on: ubuntu-latest
# The bit about who may run this job may be better put into steps, so we can extract from some configuration.
# The goal: only react to comments from curators!
if: >
github.event_name == 'issue_comment' &&
github.event.comment.author_association == 'MEMBER' &&
contains(github.event.comment.body, '/hermes reject')
steps:
- run: echo 'Curation was rejected. Cleaning up now.'
# TODO: do some cleanup here.