Skip to content

Commit 656acca

Browse files
committed
chore: merge branch
2 parents 1bbbbe2 + 58bb7c8 commit 656acca

File tree

15 files changed

+233
-129
lines changed

15 files changed

+233
-129
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This workflow file was originally based on work by GitHub user "peaceiris":
88
# https://github.com/peaceiris/actions-gh-pages
99

10-
name: Update docs on GitHub
10+
name: Build docs for gh-pages
1111

1212
on:
1313
push:

CHANGES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change log for IGA
22

3+
## Version 1.2.2 (2023-11-08)
4+
5+
Changes in this release:
6+
* Fixed [issue #28](https://github.com/caltechlibrary/iga/issues/28): catch and report the case where a repo has no releases.
7+
* Fixed a bug that manifested when the GitHub access token was invalid.
8+
* Fixed a syntax bug in the Makefile.
9+
* Improved (hopefully) the caching of python dependencies to actually work this time.
10+
* Improved (hopefully) some of the diagnostic error messages.
11+
* Added Tom Morrell to the CITATION.cff file.
12+
13+
314
## Version 1.2.1 (2023-07-24)
415

516
Changes in this release:

CITATION.cff

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ authors:
77
given-names: Michael
88
affiliation: "Caltech Library"
99
orcid: "https://orid.org/0000-0001-9105-5960"
10+
- family-names: Morrell
11+
given-names: Tom
12+
affiliation: "Caltech Library"
13+
orcid: "https://orcid.org/0000-0001-9266-5146"
1014
version: "1.2.1"
1115
date-released: "2023-07-24"
1216
doi: 10.22002/62htz-vpt80

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ define instructions_text =
101101
11. Run $(color)make test-pypi$(reset).
102102
12. Check $(link)https://test.pypi.org/project/$(progname)$(reset)
103103
13. Run $(color)make pypi$(reset).
104+
14. Update the GitHub Marketplace version via the interface at
105+
$(link)$(repo_url)/releases$(reset)
104106
endef
105107

106108

@@ -232,14 +234,15 @@ release-on-github: | update-all commit-updates
232234
sleep 2
233235
$(EDITOR) $(tmp_file)
234236
gh release create $(tag) -t "Release $(version)" -F $(tmp_file)
237+
gh release edit $(tag) --latest
235238

236239
wait-on-iga:
237240
@$(info ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓)
238241
@$(info ┃ Wait for the archiving workflow to finish on GitHub ┃)
239242
@$(info ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛)
240243
sleep 2
241244
$(eval pid := $(shell gh run list --workflow=iga.yml --limit 1 | tail -1 | awk -F $$'\t' '{print $$7}'))
242-
$(shell gh run watch $(pid))
245+
gh run watch $(pid)
243246

244247
print-next-steps: vars
245248
@$(info ┏━━━━━━━━━━━━┓)

action.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,19 @@ inputs:
5353
default: 'latest'
5454
required: false
5555
type: string
56+
57+
# The following input parameters are not exposed in the workflow recommended
58+
# for users, but can be added by developers when desired.
5659
iga_copy:
5760
description: "(For developers only) Which copy of IGA to install."
5861
default: 'iga'
5962
required: false
6063
type: string
64+
no_cache:
65+
description: "(For developers only) Don't cache Python dependencies."
66+
default: false
67+
required: false
68+
type: boolean
6169

6270
runs:
6371
using: composite
@@ -76,6 +84,7 @@ runs:
7684
if [ "${{inputs.INVENIO_TOKEN}}" == '' ]; then
7785
echo "error='the value of INVENIO_TOKEN is not set.'" >> $GITHUB_ENV
7886
fi
87+
echo python_packages_installed=false >> $GITHUB_ENV
7988
8089
- name: Abort rest of workflow and report errors.
8190
uses: actions/github-script@v6
@@ -100,16 +109,18 @@ runs:
100109
python-version: "3.11.4"
101110

102111
- name: Set up cache for Python dependencies.
103-
uses: actions/cache@v3.2.4
112+
uses: actions/cache@v3.3.1
104113
id: cache
105114
with:
106115
path: ${{ env.pythonLocation }}
107116
key: ${{ env.pythonLocation }}-${{ hashFiles('.git/iga-requirements.txt') }}
117+
enableCrossOsArchive: true
108118

109119
- name: Install IGA and dependencies if not found in cache.
110-
if: steps.cache.outputs.cache-hit != 'true'
120+
if: steps.cache.outputs.cache-hit != 'true' || inputs.no_cache == 'true'
111121
shell: bash
112122
run: |
123+
echo python_packages_installed=true >> $GITHUB_ENV
113124
python -m pip install ${{inputs.iga_copy}}
114125
115126
- name: Find out the latest release tag for this repo.
@@ -233,6 +244,14 @@ runs:
233244
fi
234245
echo "" >> $GITHUB_STEP_SUMMARY
235246
echo "This workflow ran $(iga --version | head -1 | sed s/iga/IGA/)." >> $GITHUB_STEP_SUMMARY
247+
if [ "${{env.python_packages_installed}}" == 'true' ]; then
248+
echo "" >> $GITHUB_STEP_SUMMARY
249+
echo -n "_Note: This run of IGA took extra long because it" >> $GITHUB_STEP_SUMMARY
250+
echo -n " had to install many Python packages and cache" >> $GITHUB_STEP_SUMMARY
251+
echo -n " them in GitHub's workflow framework. Future runs" >> $GITHUB_STEP_SUMMARY
252+
echo -n " of IGA will not need to perform this step and" >> $GITHUB_STEP_SUMMARY
253+
echo " the workflow should take much less time to run._" >> $GITHUB_STEP_SUMMARY
254+
fi
236255
237256
author: "Michael Hucka -- https://github.com/mhucka"
238257
branding:

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "InvenioRDM GitHub Archiver (IGA)",
55
"identifier": "iga",
66
"description": "The InvenioRDM GitHub Archiver (IGA) automatically archives GitHub releases in an InvenioRDM repository.",
7-
"version": "1.2.1",
7+
"version": "1.2.2",
88
"datePublished": "2023-07-24",
99
"dateCreated": "2022-12-07",
1010
"author": [

docs/Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# =============================================================================
21
# @file Makefile
32
# @brief Makefile for building docs using Sphinx and MyST
43
# @created 2021-01-25
54
# @license Please see the file named LICENSE in the project directory
65
# @website https://github.com/caltechlibrary/iga
7-
# =============================================================================
86

97
# Before we go any further, test if certain programs are available.
108
# The following is based on the approach posted by Jonathan Ben-Avraham to
@@ -22,23 +20,27 @@ TEST := $(foreach p,$(PROGRAMS_NEEDED),\
2220

2321
SPHINXOPTS ?=
2422
SPHINXBUILD ?= sphinx-build
25-
SPHINXAUTO = sphinx-autobuild
26-
SOURCEDIR = .
27-
BUILDDIR = _build
23+
SPHINXAUTO = sphinx-autobuild
24+
SRCDIR = .
25+
BUILDDIR = _build
2826

2927
# Actions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3028

3129
# Put it first so that "make" without argument is like "make help".
3230
help:
33-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
31+
@echo "Available commands:"
32+
@echo " auto to watch source directory & rebuild docs if files change" |\
33+
expand -t 14
34+
@$(SPHINXBUILD) -M help "$(SRCDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |\
35+
egrep -v '^Sphinx|Please' | sort | expand -t 20
3436

3537
auto autobuild live livehtml:
36-
@$(SPHINXAUTO) "$(SOURCEDIR)" "$(BUILDDIR)"/html $(SPHINXOPTS) $(O)
38+
@$(SPHINXAUTO) "$(SRCDIR)" "$(BUILDDIR)"/html $(SPHINXOPTS) $(O)
3739

3840
# Catch-all target: route all unknown targets to Sphinx using the new
3941
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
4042
%: Makefile
41-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
43+
@$(SPHINXBUILD) -M $@ "$(SRCDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
4244

4345

4446
# Cleanup and miscellaneous directives ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# InvenioRDM GitHub Archiver<img width="50em" align="right" style="display: block; margin: auto auto 2em 2em" src="_static/media/cloud-upload.svg">
22

3-
[InvenioRDM](https://inveniosoftware.org/products/rdm/) is the basis for many institutional repositories such as [CaltechDATA](https://data.caltech.edu) that enable users to preserve software and data sets in long-term archive. Though such repositories are critical resources, creating detailed records and uploading assets can be a tedious and error-prone process if done manually. This is where the [_InvenioRDM GitHub Archiver_](https://github.com/caltechlibrary/iga) (IGA) comes in.
3+
[InvenioRDM](https://inveniosoftware.org/products/rdm/) is used by many institutional repositories such as [CaltechDATA](https://data.caltech.edu) to let users preserve software and data in a long-term archive managed by their institution. Depositing software and/or data into these repositories requires the creation of detailed metadata records &ndash; a tedious and error-prone process if done manually. This is where the [_InvenioRDM GitHub Archiver_](https://github.com/caltechlibrary/iga) (IGA) comes in.
44

5-
IGA creates metadata records and sends releases from GitHub to an InvenioRDM-based repository server. IGA can be invoked from the command line; it also can be set up as a [GitHub Action](https://docs.github.com/en/actions) to archive GitHub releases automatically for a repository each time they are made.
5+
IGA can create metadata records and send releases from GitHub to an InvenioRDM-based repository server. It can be run as a command line program; it also can be set up as a [GitHub Action](https://docs.github.com/en/actions) to archive GitHub releases in InvenioRDM automatically each time they are made.
66

77
<figure>
88
<img align="middle" src="_static/media/example-github-release.jpg" width="40%">

docs/introduction.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Introduction
22

3-
[InvenioRDM](https://inveniosoftware.org/products/rdm/) is a research data management (RDM) repository platform based on the [Invenio Framework](https://inveniosoftware.org/products/framework/) and [Zenodo](https://www.zenodo.org). At institutions like Caltech, InvenioRDM is used as the basis for institutional repositories such as [CaltechDATA](https://data.caltech.edu). Of particular interest to software developers is that a repository like [CaltechDATA](https://data.caltech.edu) offers the means to preserve software projects in a long-term archive managed by their institution. Here is a screenshot of an example software project release archived in [CaltechDATA](https://data.caltech.edu):
3+
[InvenioRDM](https://inveniosoftware.org/products/rdm/) is a research data management (RDM) repository platform based on the [Invenio Framework](https://inveniosoftware.org/products/framework/) and [Zenodo](https://www.zenodo.org). At institutions like Caltech, InvenioRDM is used as the basis for institutional repositories such as [CaltechDATA](https://data.caltech.edu). It offers the means to preserve software and data projects in a long-term archive managed by their institution.
44

55
<figure>
66
<img src="_static/media/example-record-landing-page.jpg" width="80%">
7-
<figcaption>Example of a landing page for a record in CaltechDATA.</figcaption>
7+
<figcaption>Screenshot of a landing page for a record in <a href="https://data.caltech.edu">CaltechDATA</a>. The source code for version 1.3.5 of the software project <a href="https://data.caltech.edu/records/fqmae-krq60">eprints2archives</a> has been archived in the repository, and this example shows some of the metadata associated with that archived copy.</figcaption>
88
</figure>
99

1010
The metadata contained in the record of a deposit is critical to making the record widely discoverable by other people, but it can be tedious and error-prone to enter the metadata by hand. This is where automation such as IGA come in: _IGA can save users the trouble of depositing software and filling out the metadata record in InvenioRDM by performing all the steps automatically._
@@ -50,12 +50,12 @@ IGA looks for `codemeta.json` and `CITATION.cff` files in a repository and uses
5050

5151
## Using IGA
5252

53-
IGA makes it easy to archive any release from GitHub into an InvenioRDM server. Once you have a personal access token ([PAT](glossary.md#term-PAT)) for InvenioRDM (and optionally for GitHub too) and have set the environment variable `INVENIO_TOKEN` (and optionally `GITHUB_TOKEN`), you can archive a GitHub release as easily as in this example:
53+
IGA makes it easy to archive any release from GitHub into an InvenioRDM server. Once you have a personal access token ([PAT](glossary.md#term-PAT)) for InvenioRDM (and optionally, one for GitHub too) and have set the environment variable `INVENIO_TOKEN` (and optionally `GITHUB_TOKEN`), you can archive a GitHub release as easily as in this example:
5454
```shell
5555
iga -s data.caltech.edu https://github.com/mhucka/taupe/releases/tag/v1.2.0
5656
```
5757
IGA will contact GitHub, extract metadata from the release and the repository, construct a metadata record in the format required by InvenioRDM, and send the record plus the GitHub release source archive (a [ZIP](https://en.wikipedia.org/wiki/ZIP_(file_format)) file) to the InvenioRDM server. Various options can modify IGA's behavior, as explained in detail in the section on [command-line usage of IGA](cli-usage.md).
5858

59-
Note that the availability of a command-line version of IGA means you can also use it to send _past_ releases to an InvenioRDM server &ndash; IGA doesn't care if what you're asking it to archive is the _latest_ release of something; it can archive any release. This makes it useful for archiving past projects; it also makes it possible for institutions to easily perform activities such as archiving software on behalf of faculty and students.
59+
Note that the availability of a command-line version of IGA means you can also use it to send _past_ GitHub releases to an InvenioRDM server &ndash; IGA doesn't care if what you're asking it to archive is the _latest_ release of something; it can archive any release. This makes it useful for archiving past projects; it also makes it possible for institutions to easily perform activities such as archiving software on behalf of faculty and students.
6060

6161
As a GitHub Action, IGA allows you to set up a GitHub workflow that will automatically send new releases to a designated InvenioRDM server. The procedure for this is detailed in the section on [GitHub Action usage of IGA](gha-usage.md). Once set up, you do not have to remember to send releases of a particular GitHub project to InvenioRDM &ndash; it will do it for you.

docs/quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ flowchart TD;
3434
4. On the page that is shown after you click that button, name your token (the name does not matter) and click the <kbd>Create</kbd> button<figure><img src="_static/media/new-pat.png" width="50%"></figure>
3535
5. After InvenioRDM creates and shows you the token, **copy it to a safe location** because InvenioRDM will not show it again
3636

37-
## Configuring a local IGA
37+
## Configuring IGA for local use
3838

3939
To send a GitHub release to your InvenioRDM server, IGA needs this information:
4040
1. (Required) The identity of the GitHub release to be archived
@@ -49,7 +49,7 @@ export INVENIO_TOKEN=qKLoOH0KYf4D98PGYQGnC09hiuqw3Y1SZllYnonRVzGJbWz2
4949
export GITHUB_TOKEN=ghp_wQXp6sy3AsKyyEo4l9esHNxOdo6T34Zsthz
5050
```
5151

52-
Once these are set, use of IGA can be as simple as providing a URL for a release in GitHub. For example, the following command creates a draft record (the `-d` option is short for `--draft`) for another project in GitHub and tells IGA to open (the `-o` option is short for `--open`) the newly-created InvenioRDM entry in a web browser:
52+
Once these are set, use of IGA can be as simple as providing a URL for a release in GitHub. For example, the following command creates a draft record (the `-d` option is short for `--draft`) for a certain project in GitHub and tells IGA to open (the `-o` option is short for `--open`) the newly-created InvenioRDM entry in a web browser:
5353
```shell
5454
iga -d -o https://github.com/mhucka/taupe/releases/tag/v1.2.0
5555
```

0 commit comments

Comments
 (0)