https://github.com/renddslow/gitflow-release
https://github.com/renddslow/gitflow-release
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/renddslow/gitflow-release
- Owner: Renddslow
- Created: 2020-03-17T17:57:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T10:17:58.000Z (almost 3 years ago)
- Last Synced: 2025-01-21T17:26:05.990Z (12 months ago)
- Language: TypeScript
- Size: 488 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitFlow Release
> Do git-flow releases magically
## Install
```
yarn add gitflow-release
```
## Usage
```js
const release = require('gitflow-release');
release('Renddslow/gitflow-release', '1.0.0', { host: 'github' }).then((version) => {
npmRelease(version);
notifySlack(version);
});
```
## API
### `release(repo, version, opts)`
Runs a series of git commands in keeping with standard git-flow release workflow synchronously.
#### repo
- Type: `string`
- Required: ✅
A string indicating a repo owner and repo name in the format of: `/`. Passing in a string outside of that format will present and error.
#### version
- Type: `string`
- Required: ✅
A valid semver string indicating the version of the repo that is being released. **Note**: `giftflow-release` will clean the version such that `v1.0.1` becomes `1.0.1`.
#### opts
- Type: `object`
- Required: ❌
##### Parameters
| Name | Type | Default | Description |
| --------------- | ---------------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| clone | `boolean` | `true` | Whether or not to clone the repository from remote. If the repo is already local, you can set this to false, and `gitflow-release` will assume the repository is in the `cwd` |
| cwd | `string` | `process.cwd()` | The directory where you would like the repository to be cloned to |
| host | `'github' \| 'bitbucket'` | | This must be included if `clone` is true. |
| releaseBranch | `string` | `release/v` | By default we will base the release-branch name on the provided version, however, you can provide your own release branch name if you have a different system. |
| releaseBranchCb | `((version: string) => void \| Promise)` | | |
| tagFormat | `string` | `'v{major}.{minor}.{patch}{suffix}'` | A tag format that will be used to tag the commit via `git tag`. Your provided version will be parsed out, making `major`, `minor`, `patch`, and any additional "`suffix`" material available as variables. If you choose not to include any of those variables, that's fine as well. |
| verbose | `boolean` | `false` | Mark true to include log messages and stdout messages from every command |