# node-pre-gyp-github

> A node-pre-gyp module which provides the ability to publish to GitHub releases.

Latest version **2.0.0** (published 2024-05-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-pre-gyp-github
pnpm add node-pre-gyp-github
yarn add node-pre-gyp-github
bun add node-pre-gyp-github
```

Provides the command `node-pre-gyp-github`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2024-05-13 |
| First published | 2015-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 54 |
| Author | Bill Christo |
| Maintainers | bchr02, richienb, daniellockyer |
| Keywords | node-pre-gyp, binary, bindings, c++, c, native, addon, module, github, releases |

## Links

- npm: https://www.npmjs.com/package/node-pre-gyp-github
- Repository: https://github.com/bchr02/node-pre-gyp-github
- Homepage: https://github.com/bchr02/node-pre-gyp-github#readme
- Issues: https://github.com/bchr02/node-pre-gyp-github/issues
- npm.io page: https://npm.io/package/node-pre-gyp-github

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) 12.0.0
- [@octokit/rest](https://npm.io/package/@octokit/rest.md) 20.1.1

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2024-05-13
- 1.4.5 — 2024-05-13
- 1.4.6 — 2024-05-13
- 1.4.4 — 2022-04-13
- 1.4.3 — 2018-12-01
- 1.4.2 — 2018-09-22
- 1.4.1 — 2018-08-04
- 1.4.0 — 2018-08-04
- 1.3.1 — 2016-06-03
- 1.3.0 — 2016-06-02
- 1.2.2 — 2016-06-01
- 1.2.1 — 2016-05-26
- 1.2.0 — 2016-05-24
- 1.1.2 — 2015-12-24
- 1.1.1 — 2015-12-23
- … 8 more at https://npm.io/package/node-pre-gyp-github/versions

## README

# node-pre-gyp-github

##### A node-pre-gyp module which provides the ability to publish to GitHub releases.

[![Coverage Status](https://coveralls.io/repos/github/bchr02/node-pre-gyp-github/badge.svg?branch=master)](https://coveralls.io/github/bchr02/node-pre-gyp-github?branch=master)
[![Join the chat at https://gitter.im/bchr02/node-pre-gyp-github](https://badges.gitter.im/bchr02/node-pre-gyp-github.svg)](https://gitter.im/bchr02/node-pre-gyp-github?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Usage

Instead of ```node-pre-gyp publish``` use **```node-pre-gyp-github publish```**

## Options for publish command

* --silent : Turns verbose messages off.
* --release : Publish the GitHub Release immediately instead of creating a Draft.

  For Ex. ```node-pre-gyp-github publish --release```

## Install

```bash
npm install -g node-pre-gyp-github
# or
yarn global add node-pre-gyp-github

```

## Configuration

This module is intended to be used with node-pre-gyp. Therefore, be sure to configure and install node-pre-gyp first. After having done that, within **```package.json```** update the ```binary``` properties ```host``` and ```remote_path``` so it matches the following format:

```json
  "host": "https://github.com/[owner]/[repo]/releases/download/",
  "remote_path": "{version}"
```

Be sure to replace ```[owner]```, ```[repo]```, with actual values,
but DO NOT replace ```{version}``` with actual version.

***WARNING: Variable substitutions are not supported on the ```host``` property and on the ```remote_path``` only ```{version}``` placeholder is supported. The value of ```remote_path``` after substitution will become a release tag name. Do not use [forbidden git tag characters](https://git-scm.com/docs/git-check-ref-format) for ```version``` and ```remote_path``` properties.***

Within GitHub, create a new authorization:

1. go to `Settings` -> `Developer settings`
2. click [`Personal access tokens`](https://github.com/settings/tokens)
3. click `Generate new token`
4. Select `public_repo` and `repo_deployment`
5. Generate Token
6. copy the key that's generated and set `NODE_PRE_GYP_GITHUB_TOKEN` environment variable to it. Within your command prompt:

```
SET NODE_PRE_GYP_GITHUB_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```

## Example (Publish to GitHub as a Draft Release)

1. node-pre-gyp configure
2. node-pre-gyp build
3. node-pre-gyp package
4. node-pre-gyp-github publish

## Example (Publish to GitHub as a Release)

1. node-pre-gyp configure
2. node-pre-gyp build
3. node-pre-gyp package
4. node-pre-gyp-github publish --release

---
_Source: https://npm.io/package/node-pre-gyp-github · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
