Open ralphtheninja opened 6 years ago
Not yet, but this is something we most likely want to do. Do you know how other projects obtain a similar objective?
I'm one of the maintainers for leveldown
and we automatically build binaries for linux and Windows using prebuild
and prebuild-ci
.
Is the final goal to download the binaries when running npm install?
Exactly. We use prebuild-install
which downloads prebuilt binaries from GitHub. If no prebuilt can be found it falls back to a compile step. prebuild-install
caches the binaries in ~/.npm/_prebuilds
as well so when installing it checks the cache first.
Forgot to mention that we also build for osx and electron. Electron is a bit special since we build that for linux, osx and windows.
Our workflow (the level org) is basically:
travis
and AppVeyor
, then prebuild-ci
is run to see if any binaries should be built (checks if version has changed in package.json
)prebuild-ci
runs prebuild
which creates a GitHub release and uploads the binaries thereOnce the binaries are built, we do npm publish
. The reason for this is to make sure the binaries are already built before someone tries to do npm install
on the newest version.
As an example of what it can look like after a successful build, see e.g. https://github.com/Level/leveldown/releases/tag/v2.1.1 (which is a GitHub release with included binaries)
prebuild-install
then picks binaries from this release (if not already downloaded and cached), unpacks the .tar.gz
, tries to do require()
as a test that the binary actually can be required on the local system.
@ralphtheninja thanks for the detailed explanation!
I would say now it's a bit too early to bless a real release and hence make packages available. As @hellais proceeds with creating the OONI probe apps and we can be more confident around the Node bindings, I believe we should really consider going down the road you propose.
@bassosimone I can help you set it up of course. Ping me when the time is right :) I can even swing by Italy for a weekend. Ooni
is an awesome project and I'd like to help out.
Not yet, but this is something we most likely want to do. Do you know how other projects obtain a similar objective? Is the final goal to download the binaries when running
npm install
?