Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/t-ski/gh-npm-release

Simple package release script for NPM + GitHub Releases redirect
https://github.com/t-ski/gh-npm-release

Last synced: about 10 hours ago
JSON representation

Simple package release script for NPM + GitHub Releases redirect

Awesome Lists containing this project

README

        

# GitHub + NPM Release

Simple NPM package release with a linked redirect to GitHub Releases.

``` console
npm i -D t-ski/gh-npm-release
```

## CLI

``` console
npx ghnpm
```

| Release Type | `type` | `type-shorthand` |
| :- | :- | :- |
| Major |`--major` | `-M` |
| Minor | `--minor` | `-m` |
| Patch | `--patch` | `-p` |

> The command `ghnpm` has an alias `release`.

### Examples

``` console
npx ghnpm --major
```

> 🫧 A release requires the git working directory to be clean.

package.json
```
{
"scripts": {
"release": "npx release",
"release:minor": "npm release -- -m",
"release:patch": "npm release -- -p"
}
}
```

``` console
npm run release:patch
```

## API

``` ts
release(type: Type): void
```

``` ts
enum Type {
MAJOR,
MINOR,
PATCH
}
```

### Example

``` js
const ghnpm = require("@t-ski/gh-npm-release");

const ghnpm.release(ghnpm.Type.MINOR);
```

## Abstract Procedure

1. 🏷️   Bump package version:
1. Increase version according to specified Semver type.
2. Create a related git tag `v`.
2. 📢   Publish package to NPM registry.
3. 🔗   Open GitHub Releases with tag information.

> 💡 In case of an error during the procedure, the version bump is reverted.

##

© Thassilo Martin Schiepanski