Skip to content

Template repository for building and publishing NodeJS mobile prebuilds for a specific module

License

Notifications You must be signed in to change notification settings

digidem/nodejs-mobile-prebuilds-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-mobile-prebuilds-template

Template repository for building and publishing NodeJS Mobile prebuilds for a specific module

Getting started

  1. Create a new repository from this template using the GitHub UI. Alternatively can fork it.

  2. Update the environment variables defined in the workflow file based on your needs:

    • NODE_VERSION: the Node version to use for building (you most likely do not need to change this)
    • MODULE_NAME: the name of the module that you're building prebuilds for
    • MODULE_VERSION: the package version of the module that your'e building (you most likely do not need to change this)
  3. Remove the Getting started section of this README! (since it's specific to the template repo)

Working locally

Requirements

  • Node 18
  • Android NDK 24.0.8215888
    • (optional) exported ANDROID_NDK_HOME environment variable

General steps

Should be clear enough to follow the workflow steps but in summary:

  1. Download the npm tarball package and unzip e.g. npm pack foo@latest | xargs tar -zxvf (replace foo@latest with the relevant package name and version)

  2. Navigate to unzipped directory and run npx prebuild-for-nodejs-mobile TARGET, where TARGET is an accepted value from the prebuild-for-nodejs-mobile CLI

    • if you don't have the ANDROID_NDK_HOME environment variable exported, you may run the command like so: ANDROID_NDK_HOME=/path/to/ndk npx prebuild-for-nodejs-mobile TARGET

Creating a release

  1. Create a git tag that matches the version of the module you want to create prebuilds for e.g. git tag 1.0.0

  2. Push the tag to the remote e.g. git push origin 1.0.0

  3. The workflow uses the tag version to create the prebuilds and then publish a release with those prebuilds.

  4. The relevant artifacts will show up in GitHub Releases. Each artifact is a tarball containing the .node files for the target-specific prebuild.

About

Template repository for building and publishing NodeJS mobile prebuilds for a specific module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published