Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/t-ski/gh-npm-release
- Owner: t-ski
- License: mit
- Created: 2024-06-29T09:50:48.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-30T23:48:45.000Z (5 months ago)
- Last Synced: 2024-07-05T04:59:26.209Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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