Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Add node-pre-gyp to publish binaries#135

Merged
smashwilson merged 2 commits intoatom:masterfrom
caseywebdev:publish-binary
Apr 26, 2018
Merged

Add node-pre-gyp to publish binaries#135
smashwilson merged 2 commits intoatom:masterfrom
caseywebdev:publish-binary

Conversation

@caseywebdev
Copy link
Copy Markdown
Contributor

@caseywebdev caseywebdev commented Apr 6, 2018

This PR adds node-pre-gyp (https://github.com/mapbox/node-pre-gyp) to handle binary packaging and publishing. I tested npm install and npm run publish with my AWS creds for the atom-watcher-test S3 bucket I created and it all worked as expected.

A couple things will need to be handled by the maintainers of this package:

  1. We'll need an S3 bucket for the binaries.
  2. Upload creds for said bucket will need to be added to the CI tools.
  3. A method of releasing builds will need to be decided. Common practices that I've seen:
    • Publish when a specific token exists in the commit message, ie [ci-publish]
    • Publish when a git tag is pushed

Alternate Designs

What node-pre-gyp does could be manually handled, but it seems node-pre-gyp is pretty well established and worked for me with minimal configuration.

Benefits

Uploading built binaries will save time for everyone wanting to install this package.

Possible Drawbacks

If a prebuilt binary doesn't exist, the tool will fallback and build locally, so there's little drawback to this addition.

Applicable Issues

Closes #134

/cc @smashwilson

@daviwil
Copy link
Copy Markdown

daviwil commented Apr 6, 2018

I prefer prebuild for this because it can auto-upload binaries to the tag's GitHub release, no S3 bucket needed. Any chance node-pre-gyp can do the same?

@caseywebdev
Copy link
Copy Markdown
Contributor Author

Ah, didn’t know about preload. I agree it’s nicer to not add the S3 dep.

@caseywebdev
Copy link
Copy Markdown
Contributor Author

Turns out there's a nifty node-pre-gyp-github plugin that uses GitHub releases as a publish target.

The only thing required for this new update to work is an envvar in the CI NODE_PRE_GYP_GITHUB_TOKEN=<token with release write access>

@smashwilson smashwilson merged commit ffe3c39 into atom:master Apr 26, 2018
"author": "GitHub",
"license": "MIT",
"devDependencies": {
"aws-sdk": "2.220.1",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this may have snuck in from the previous S3 based solution?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, possible. I can take it out and see if things still work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea that was a prereq for s3, should be removable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants