UNPKG

2.5 kBMarkdownView Raw
1# github-semantic-version
2
3> Automated semantic version releases powered by Github Issues.
4
5[![travis build](https://img.shields.io/travis/ericclemmons/github-semantic-version.svg)](https://travis-ci.org/ericclemmons/github-semantic-version)
6[![version](https://img.shields.io/npm/v/github-semantic-version.svg)](http://npm.im/github-semantic-version)
7[![downloads](https://img.shields.io/npm/dm/github-semantic-version.svg)](http://npm-stat.com/charts.html?package=github-semantic-version)
8[![MIT License](https://img.shields.io/npm/l/github-semantic-version.svg)](http://opensource.org/licenses/MIT)
9
10- - -
11
12## Getting Started
13
14### 1. Install
15
16```shell
17$ npm install --save-dev github-semantic-version
18```
19
20### 2. Add `GH_TOKEN` & `NPM_TOKEN` to CI
21
22For example, in Travis CI's "Settings" tab for your project, you'll see:
23> ![tokens](tokens.png)
24
25For your `GH_TOKEN` [create one in Github](https://github.com/settings/tokens)
26with `repo` credentials.
27
28You can find `NPM_TOKEN` in your `~/.npmrc` file:
29
30```
31//registry.npmjs.org/:_authToken=${NPM_TOKEN}
32```
33
34
35### 3. Create labels
36
37```shell
38$ npm install --save-dev git-labelmaker
39```
40
41```shell
42$ git-labelmaker
43? What is your GitHub Access Token? <paste token here>
44? What is your master password, to keep your access token secure? ************
45? Welcome to git-labelmaker!
46What would you like to do?
47> Add Labels From Package
48? What is the path & name of the package you want to use? (eg: `packages/my-label-pkg.json`) ./node_modules/github-semantic-version/labels.json
49Successfully created 3 labels
50```
51
52### 4. Add labels to issues
53
54Add one of the following labels to your open PRs:
55
56- `Version: Major`
57- `Version: Minor`
58- `Version: Patch`
59
60As these get merged, `github-semantic-version` will use this to determine
61how to bump the current version.
62
63_If any un-tagged commits are pushed to `master` outside of a PR, they're
64automatically treated as `patch` releases._
65
66Once these are in place, your new versions can be pushed back to Github & NPM
67without permissions & security issues.
68
69### 5. Update `.travis.yml`
70
71```yaml
72deploy:
73 provider: script
74 script: npm run deploy
75 skip_cleanup: true
76 on:
77 branch: master
78```
79
80### 6. Update `package.json`
81
82```json
83{
84 "scripts": {
85 "predeploy": "github-semantic-version",
86 "deploy": "npm publish"
87 }
88}
89```
90
91If you're working on an private project, you can leave out `npm publish`, which
92means you have no need for your `NPM_TOKEN` either.
93
94
95### License
96
97> MIT License 2016 © Eric Clemmons