|
| 1 | +# ==================================================================== |
| 2 | +# GitHub Actions workflow for InvenioRDM GitHub Archiver version 1.0.3 |
| 3 | +# This is available as the file "sample-workflow.yml" from the open- |
| 4 | +# source repository for IGA at https://github.com/caltechlibrary/iga/. |
| 5 | +# ==================================================================== |
| 6 | + |
1 | 7 | name: InvenioRDM GitHub Archiver
|
2 | 8 | env:
|
3 | 9 | INVENIO_SERVER: https://data.caltech.edu
|
4 | 10 |
|
5 |
| - # These variables are IGA options. Please see the docs for info. |
| 11 | + # Set to an InvenioRDM record ID to mark release as a new version. |
| 12 | + parent_record: none |
| 13 | + |
| 14 | + # The variables below are other IGA options. Please see the docs. |
| 15 | + community: none |
6 | 16 | draft: false
|
7 | 17 | all_assets: false
|
8 | 18 | all_metadata: false
|
9 |
| - community: none |
10 |
| - parent_record: "mfc5m-5qe88" |
11 | 19 | debug: false
|
12 | 20 |
|
13 |
| -# ~~~~~~~~~~ The rest of this file should be left as-is ~~~~~~~~~~ |
| 21 | +# ~~~~~~~~~~~~ The rest of this file should be left as-is ~~~~~~~~~~~~ |
| 22 | + |
14 | 23 | on:
|
15 | 24 | release:
|
16 | 25 | types: [published]
|
17 | 26 | workflow_dispatch:
|
18 | 27 | inputs:
|
19 | 28 | release_tag:
|
20 |
| - description: "The tag of the release to archive:" |
| 29 | + description: "The release tag (empty = latest):" |
21 | 30 | draft:
|
22 | 31 | default: false
|
23 |
| - description: "Mark the record as a draft:" |
| 32 | + description: "Mark the InvenioRDM record as a draft:" |
| 33 | + parent_record: |
| 34 | + description: "ID of parent record (for versioning):" |
| 35 | + community: |
| 36 | + description: "Name of InvenioRDM community (if any):" |
24 | 37 | all_assets:
|
25 | 38 | default: false
|
26 | 39 | description: "Attach all GitHub assets:"
|
27 | 40 | all_metadata:
|
28 | 41 | default: false
|
29 | 42 | description: "Include additional GitHub metadata:"
|
30 |
| - community: |
31 |
| - description: "Send record to InvenioRDM community:" |
32 |
| - parent_record: |
33 |
| - description: "ID of parent record (for versioning):" |
| 43 | + debug: |
| 44 | + default: false |
| 45 | + description: "Print debug info in the GitHub log:" |
| 46 | + |
34 | 47 | jobs:
|
35 |
| - Send_to_InvenioRDM: |
| 48 | + run_iga: |
| 49 | + name: "Send to ${{needs.get_repository.outputs.server}}" |
36 | 50 | runs-on: ubuntu-latest
|
| 51 | + needs: get_repository |
37 | 52 | steps:
|
38 | 53 | - uses: caltechlibrary/iga@main
|
39 | 54 | with:
|
40 | 55 | INVENIO_SERVER: ${{env.INVENIO_SERVER}}
|
41 | 56 | INVENIO_TOKEN: ${{secrets.INVENIO_TOKEN}}
|
42 | 57 | all_assets: ${{github.event.inputs.all_assets || env.all_assets}}
|
43 | 58 | all_metadata: ${{github.event.inputs.all_metadata || env.all_metadata}}
|
44 |
| - debug: ${{github.event.inputs.debug || 'false'}} |
| 59 | + debug: ${{github.event.inputs.debug || env.debug}} |
45 | 60 | draft: ${{github.event.inputs.draft || env.draft}}
|
46 | 61 | community: ${{github.event.inputs.community || env.community}}
|
47 | 62 | parent_record: ${{github.event.inputs.parent_record || env.parent_record}}
|
48 | 63 | release_tag: ${{github.event.inputs.release_tag || 'latest'}}
|
| 64 | + get_repository: |
| 65 | + name: "Get repository name" |
| 66 | + runs-on: ubuntu-latest |
| 67 | + outputs: |
| 68 | + server: ${{steps.parse.outputs.host}} |
| 69 | + steps: |
| 70 | + - id: parse |
| 71 | + run: echo "host=$(cut -d'/' -f3 <<< ${{env.INVENIO_SERVER}} | cut -d':' -f1)" >> $GITHUB_OUTPUT |
0 commit comments