Skip to content

Commit ea57280

Browse files
Merge pull request #293 from bigchaindb/add-release-process
Document the release process and update the "release-it" options
2 parents d4dae79 + 667e2c9 commit ea57280

File tree

3 files changed

+101
-5
lines changed

3 files changed

+101
-5
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ Code is Apache-2.0 and docs are CC-BY-4.0
4040
- [BigchainDB Documentation](#bigchaindb-documentation)
4141
- [Speed Optimizations](#speed-optimizations)
4242
- [Development](#development)
43+
- [Release Process](#release-process)
4344
- [Authors](#authors)
44-
- [License](#license)
45+
- [Licenses](#licenses)
4546

4647
---
4748

@@ -185,6 +186,10 @@ After updating source files in `src/`, make sure to update the API documentation
185186
npm run doc
186187
```
187188

189+
## Release Process
190+
191+
See the file named [RELEASE_PROCESS.md](RELEASE_PROCESS.md).
192+
188193
## Authors
189194

190195
* inspired by [`js-bigchaindb-quickstart`](https://github.com/sohkai/js-bigchaindb-quickstart) of @sohkhai [thanks]

RELEASE_PROCESS.md

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<!---
2+
Copyright BigchainDB GmbH and BigchainDB contributors
3+
SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
4+
Code is Apache-2.0 and docs are CC-BY-4.0
5+
--->
6+
7+
# Our Release Process
8+
9+
## Notes
10+
11+
BigchainDB follows
12+
[the Python form of Semantic Versioning](https://packaging.python.org/tutorials/distributing-packages/#choosing-a-versioning-scheme)
13+
(i.e. MAJOR.MINOR.PATCH),
14+
which is almost identical
15+
to [regular semantic versioning](http://semver.org/), but there's no hyphen, e.g.
16+
17+
- `0.9.0` for a typical final release
18+
- `4.5.2a1` not `4.5.2-a1` for the first Alpha release
19+
- `3.4.5rc2` not `3.4.5-rc2` for Release Candidate 2
20+
21+
**Note:** For Git tags (which are used to identify releases on GitHub), we append a `v` in front.
22+
23+
We follow [BEP-1](https://github.com/bigchaindb/BEPs/tree/master/1), which is our variant of C4, the Collective Code Construction Contract, so a release is just a [tagged commit](https://git-scm.com/book/en/v2/Git-Basics-Tagging) on the `master` branch, i.e. a label for a particular Git commit.
24+
25+
## Steps
26+
27+
1. Make sure you have a recent version of node and npm.
28+
1. `npm install`
29+
1. Update all npm package dependencies, where possible. You might have to freeze some versions. Run all tests locally (`npm run test`) and make sure they pass. Make a pull request (to be merged into the `master` branch) and make sure all tests are passing there (in Travis). Merge the pull request.
30+
1. Make sure your local `master` branch is in sync with GitHub: `git checkout master` and `git pull`
31+
1. Do a test build:
32+
33+
`npm run build`
34+
35+
If that fails, then get it working.
36+
1. We use the [release-it](https://www.npmjs.com/package/release-it) package (from npm) to automate most of the release. Make sure you have a recent version.
37+
1. Login to npm using your npm credentials, so you can publish a new [bigchaindb-driver](https://www.npmjs.com/package/bigchaindb-driver) package there. (The npm account must haver permission to do so).
38+
39+
`npm login`
40+
41+
1. release-it needs a Github personal access token so it can interact with GitHub on your behalf. To get one, go to:
42+
43+
[https://github.com/settings/tokens](https://github.com/settings/tokens)
44+
45+
and then make that token available as an environment variable, e.g.
46+
47+
`export GITHUB_TOKEN="f941e0..."`
48+
49+
1. Do the release:
50+
51+
- For a patch release, do `npm run release`
52+
- For a minor release, do `npm run release-minor`
53+
- For a major release, do `npm run release-major`
54+
55+
If your npm account is using two-factor authentication,
56+
you will have to append a one-time password (OTP) like `--npm.otp=123456`.
57+
The above command will automatically do a bunch of things:
58+
59+
- bump the project version in `package.json`, then git commit and git push it.
60+
- create a new Git tag of the form `v{verson}`, e.g. `v1.2.3`
61+
- create a new [GitHub release](https://github.com/bigchaindb/js-bigchaindb-driver/releases).
62+
- publish a new npm release
63+
64+
To see all the arguments passed to `release-it`, search for "release" in [package.json](package.json). The arguments are documented in the [release-it GitHub repo](https://github.com/release-it/release-it).
65+
66+
1. Make sure everything worked as expected.
67+
68+
- Was the version number bumped properly in [package.json](package.json)?
69+
- Was a new Git tag created? See the [list of tags](https://github.com/bigchaindb/js-bigchaindb-driver/tags).
70+
- Was a new GitHub release created? See the [list of releases](https://github.com/bigchaindb/js-bigchaindb-driver/releases).
71+
- Was a new npm package published on npm? [Check on npmjs.com](https://www.npmjs.com/package/bigchaindb-driver).
72+
73+
1. You can edit the description of the GitHub release to add or remove details.
74+
75+
If the docs were updated since the last release, [login to readthedocs.org](https://readthedocs.org/accounts/login/) and go to the **BigchainDB JavaScript Driver** project, then:
76+
77+
1. Click on "Builds", select "latest" from the drop-down menu, then click the "Build Version:" button.
78+
1. Wait for the build of "latest" to finish. This can take a few minutes.
79+
1. Go to Admin --> Advanced Settings
80+
and make sure that "Default branch:" (i.e. what "latest" points to)
81+
is set to the new release's tag, e.g. `v0.9.1`.
82+
(It won't be an option if you didn't wait for the build of "latest" to finish.)
83+
Then scroll to the bottom and click "Save".
84+
1. Go to Admin --> Versions
85+
and under **Choose Active Versions**, do these things:
86+
87+
1. Make sure that the new version's tag is "Active" and "Public"
88+
1. Make sure the **stable** branch is _not_ active.
89+
1. Scroll to the bottom of the page and click "Save".
90+
91+
Congratulations, you have released a new version of the BigchainDB JavaScript Driver!

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"clean": "rimraf dist/bundle dist/node",
2424
"test": "npm run lint && nyc ava test/ && npm run thanks && npm run report-coverage",
2525
"thanks": "cowsay Hi, thanks for your interest in BigchainDB. We appreciate your contribution!",
26-
"release": "./node_modules/release-it/bin/release-it.js --src.tagName='v%s' --github.release --npm.publish --non-interactive",
27-
"release-minor": "./node_modules/release-it/bin/release-it.js minor --src.tagName='v%s' --github.release --npm.publish --non-interactive",
28-
"release-major": "./node_modules/release-it/bin/release-it.js major --src.tagName='v%s' --github.release --npm.publish --non-interactive",
26+
"release": "./node_modules/release-it/bin/release-it.js --git.tagName='v${version}' --github.release --npm.publish --non-interactive",
27+
"release-minor": "./node_modules/release-it/bin/release-it.js minor --git.tagName='v${version}' --github.release --npm.publish --non-interactive",
28+
"release-major": "./node_modules/release-it/bin/release-it.js major --git.tagName='v${version}' --github.release --npm.publish --non-interactive",
2929
"prepublishOnly": "npm run build",
3030
"report-coverage": "nyc report --reporter=lcov > coverage.lcov && codecov",
3131
"doc": "node ./node_modules/documentation/bin/documentation.js build src/index.js -f md -o API.md -g --markdown-toc"
@@ -58,7 +58,7 @@
5858
"husky": "^2.1.0",
5959
"lint-staged": "^8.0.0",
6060
"nyc": "^14.0.0",
61-
"release-it": "^10.4.4",
61+
"release-it": "^12.2.0",
6262
"rimraf": "^2.6.2",
6363
"sinon": "^7.3.2",
6464
"webpack": "^4.28.4",

0 commit comments

Comments
 (0)