Closed mcous closed 2 years ago
@MadLittleMods gentle ping on this one again. Is GitHub Actions a path you'd be willing to take on this repository?
Woot woot! https://github.com/MadLittleMods/node-usb-detection/releases/tag/v4.13.0 with a multitude of prebuilds and available on npm https://www.npmjs.com/package/usb-detection/v/4.13.0 🚀
Thanks again @mcous 🥰
Overview
(Diff ignoring lockfile:
141 insertions(+), 203 deletions(-)
)As noted in #134, #140, #151, the existing CI setup has started to have issues, resulting in prebuilds not being correctly published to GitHub Releases.
From what I can tell, the problem may be that CI setup is configured somewhat redundantly. The prebuild utility is able to generate prebuilds for all available ABI versions while running on a single version of Node. However, CI is configured to run a matrix of different Node.js versions, too many of which are configured to run
prebuild --all
. Prebuilds only need to be generated once per OS/arch combination, and the compilation works most smoothly on later versions of Node.Additionally, there's a few other snags and updates since these problems started appearing:
v12
Rather than try to work around Travis'
.org
shutdown and figure out the.com
migration, I decided to see what this CI would look like on GitHub Actions. Over at Opentrons/opentrons, where we useusb-detection
, we switched from a Travis/AppVeyor combo to GH Actions, and it's gone pretty well. If the switch to GH Actions isn't too presumptuous, I think this is a good change!Relevant outputs from my fork running this CI:
Heavy caveat: I don't write native Node.js modules. This is not my area of expertise, though I'm pretty handy with a CI config. I haven't actually tested any these prebuilds; the only thing I know about these builds right now is that they are compiling without errors.
Open questions / TODO
engines.node
field inpackage.json
be bumped from4
to12
?Change log
npm
to v7, resulting in some serious lockfile churn; sorry about this diff'MACOSX_DEPLOYMENT_TARGET': '10.9'
in node-gyp confignode-gyp
now only supports Python 3 and Python 2 has been EOL'dnode-gyp
documentationHow does this CI pipeline work?
The CI pipeline starts by kicking off several jobs in parallel:
npm ci --build-from-source
on all the OS's and architectures we wantprebuild --all
and upload prebuilds to GH Actions artifact storageIf all those jobs complete and the CI run was triggered by a tag, then a publish job will run, which will: