Skip to content

Commit

Permalink
Update iga and codemeta2cff
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorrell committed Oct 29, 2024
1 parent 2fde1bb commit bb46bfc
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 32 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/codemeta2cff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CodeMeta2CFF
run-name: Run CodeMeta2CFF after ${{github.event_name}} by ${{github.actor}}

on:
push:
paths: ['codemeta.json']
workflow_dispatch:
inputs:
reason:
description: 'Reason'
required: false
default: 'Manual trigger'

jobs:
CodeMeta2CFF:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Convert CFF
uses: caltechlibrary/codemeta2cff@main
- name: Commit CFF
uses: EndBug/add-and-commit@v9
with:
message: 'Add updated CITATION.cff from codemeta.json file'
add: 'CITATION.cff'
59 changes: 28 additions & 31 deletions .github/workflows/iga.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: InvenioRDM GitHub Archiver and CodeMeta2CFF
name: InvenioRDM GitHub Archiver
env:
INVENIO_SERVER: https://data.caltech.edu

Expand All @@ -10,47 +10,43 @@ env:
parent_record: "6qhkm-7n074"
debug: false

# ~~~~~~~~~~ The rest of this file should be left as-is ~~~~~~~~~~
# ╭────────────────────────────────────────────╮
# │ The rest of this file should be left as-is │
# ╰────────────────────────────────────────────╯

name: InvenioRDM GitHub Archiver
on:
release:
types: [published]
workflow_dispatch:
inputs:
release_tag:
description: "The tag of the release to archive:"
description: The release tag (empty = latest)
parent_record:
description: ID of parent record (for versioning)
community:
description: Name of InvenioRDM community (if any)
draft:
default: false
description: "Mark the record as a draft:"
description: Mark the record as a draft
type: boolean
all_assets:
default: false
description: "Attach all GitHub assets:"
description: Attach all GitHub assets
type: boolean
all_metadata:
default: false
description: "Include additional GitHub metadata:"
community:
description: "Send record to InvenioRDM community:"
parent_record:
description: "ID of parent record (for versioning):"
description: Include additional GitHub metadata
type: boolean
debug:
description: Print debug info in the GitHub log
type: boolean

run-name: Archive ${{inputs.release_tag || 'latest release'}} in InvenioRDM
jobs:
CodeMeta2CFF:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Convert CFF
uses: caltechlibrary/codemeta2cff@main
- name: Commit CFF
uses: EndBug/add-and-commit@v9
with:
message: 'Add CITATION.cff for release'
add: "['CITATION.cff']"
push: origin HEAD:main
run_iga:
name: "Send to ${{needs.get_repository.outputs.server}}"
name: Send to ${{needs.get_repository.outputs.server}}
runs-on: ubuntu-latest
needs: [get_repository, CodeMeta2CFF]
needs: get_repository
steps:
- uses: caltechlibrary/iga@main
- uses: caltechlibrary/iga@v1
with:
INVENIO_SERVER: ${{env.INVENIO_SERVER}}
INVENIO_TOKEN: ${{secrets.INVENIO_TOKEN}}
Expand All @@ -62,10 +58,11 @@ jobs:
parent_record: ${{github.event.inputs.parent_record || env.parent_record}}
release_tag: ${{github.event.inputs.release_tag || 'latest'}}
get_repository:
name: "Get repository name"
name: Get repository name
runs-on: ubuntu-latest
outputs:
server: ${{steps.parse.outputs.host}}
steps:
- id: parse
- name: Extract name from INVENIO_SERVER
id: parse
run: echo "host=$(cut -d'/' -f3 <<< ${{env.INVENIO_SERVER}} | cut -d':' -f1)" >> $GITHUB_OUTPUT
1 change: 0 additions & 1 deletion caltechdata_api/get_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def get_metadata(
headers["Authorization"] = "Bearer %s" % token

response = requests.get(url + idv, headers=headers, verify=verify)
print(response.headers)
if response.status_code != 200:
raise Exception(response.text)
else:
Expand Down

0 comments on commit bb46bfc

Please sign in to comment.