EPrints Technical Mailing List Archive

Message: #09071


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] GitHub - an action to create an EPM from an EMPI manifest


CAUTION: This e-mail originated outside the University of Southampton.
Hi,
TL;DR: would 'we' be happy for me to create a GitHub marketplace action under the 'eprintsug' account which creates EPM packages from GitHub repos?

The details:
I've been having a bit of an experiment with GitHub actions, in relation to EPrints packages.
In an experimental fork of the Altmetric plugin, I have added an action that automatically creates a pull-request containing the EPM file generated from the most recent updates to the master branch e.g. https://github.com/jesusbagpuss/altmetric/pull/1

The action is currently part of the above fork and consists of (https://github.com/jesusbagpuss/altmetric/tree/master/.github/workflows):
- a yaml file describing the action itself
- a perl script that checks the EPMI file; files present in the repo, and then builds the EPM

I had pondered a more extensive action, that would have created a working EPrints instance, and created the epm using normal EPrints tooling. Whilst I think this is achievable and may be useful for testing that an updated plugin was working as expected (especially if it included some tests to run), I was looking for a quick way to create the package file itself.

Do people think this is a useful approach/tool?
If so, I think I can create a GitHub marketplace action from the eprintsug organisation which could be run against any plugin.

You can see the output of a 'build_epm' action here:
https://github.com/jesusbagpuss/altmetric/actions/runs/3056341547/jobs/4930402347
Under the 'Build EPM' section you can see an example of warnings generated when a file exists in the git repository but isn't referenced in the EMPI manifest.

The build script will fail if e.g. there isn't an EPMI file or if there's more than one.
It will produce warnings if files present in the repo aren't listed in the EPMI (this may be legitimate - e.g. a README for the git repo).
It will also produce a warning if a file referenced in the EPMI isn't in the git repo (this probably should create an error, and cause the build to fail).
The generated EPMI file also includes a comment about it being auto-built: https://github.com/jesusbagpuss/altmetric/blob/autobuild-epm/altmetric.epm#L2-L3

There are a couple of improvements I need to make, but thought I'd share at this point to see what you reckon.

Cheers,
John

PS New Almetric plugin available soon 🙂