uhop / install-artifact-from-github

No-dependency micro helper for developers of binary addons for Node that checks the cache for an artifact before attempting to build a project. Save time for your users!
Other
6 stars 3 forks source link
binary-addons caching github-releases

install-artifact-from-github NPM version

This is a no-dependency micro helper for developers of binary addons for Node. It is literally two small one-file utilities integrated with GitHub releases. The project solves two problems:

In general, it can save your users from a long recompilation and, in some cases, even save them from installing build tools. By using GitHub facilities (Releases and Actions) the whole process of publishing and subsequent installations are secure, transparent, painless, inexpensive, or even free for public repositories.

How to install

Installation:

npm install --save install-artifact-from-github

How to use

In your package.json (pseudo-code with comments):

{
  // your custom package.json stuff
  // ...
  "scripts": {
    // your scripts go here
    // ...

    // saves an artifact
    "save-to-github": "save-to-github-cache --artifact build/Release/ABC.node",

    // installs using pre-created artifacts
    "install": "install-from-cache --artifact build/Release/ABC.node",

    // used by "install" to test the artifact
    "verify-build": "node scripts/verify-build.js"

    // used by "install" to rebuild from sources
    "rebuild": "node-gyp rebuild"
  }
}

Examples of GitHub actions can be found in the documentation.

Documentation

The full documentation is available in the wiki.

Release history