|
| 1 | +# Releasing OpenCensus Node Packages (for Maintainers Only) |
| 2 | + |
| 3 | +This document explains how to publish all OC Node modules at version x.y.z. |
| 4 | +Ensure that you’re following [semver][semver-url] when choosing a version number. |
| 5 | + |
| 6 | +## Update to latest locally |
| 7 | + |
| 8 | +Use `git fetch` and `git checkout origin/master` to ensure you’re on the latest |
| 9 | +commit. Make sure you have no unstaged changes. Ideally, also use |
| 10 | +`git clean -dfx` to remove all ignored and untracked files. |
| 11 | + |
| 12 | +## Create a new branch |
| 13 | + |
| 14 | +Create a new branch called `x.y.z-proposal` from the current commit. |
| 15 | + |
| 16 | +## Install packages and run the version bump script |
| 17 | + |
| 18 | +Run `npm install` to make sure the packages are installed and built. Then run |
| 19 | +`npm run bump`, pick the version for `x.y.z`, and enter `y` for |
| 20 | +`Are you sure you want to publish these packages?` (They will not actually be |
| 21 | +published, just the version will be bumped). |
| 22 | + |
| 23 | +The version bump should create some unstaged changes. |
| 24 | + |
| 25 | +## Create a new commit |
| 26 | + |
| 27 | +Create a new commit with the exact title: `chore(multiple): x.y.z release proposal`. |
| 28 | + |
| 29 | +## Create a draft GitHub Release |
| 30 | + |
| 31 | +On [GitHub Releases][github-releases-url], |
| 32 | +follow the example set by recent releases to populate a summary of changes, as |
| 33 | +well as a list of commits that were applied since the last release. |
| 34 | +Running `git log --oneline --no-decorate` is a good way to get that list of |
| 35 | +commits. Save it as a draft, don’t publish it. Don’t forget the tag -- call it |
| 36 | +`vx.y.z` and leave it pointing at `master` for now (this can be changed as long |
| 37 | +as the GitHub release isn’t published). |
| 38 | + |
| 39 | +## Create a new PR |
| 40 | + |
| 41 | +Push the branch to GitHub and create a new PR with that exact name. The commit |
| 42 | +body should just be a link to the *draft* notes. Someone who can access draft |
| 43 | +notes should approve it, looking in particular for test passing, and whether the |
| 44 | +draft notes are satisfactory. |
| 45 | + |
| 46 | +## Merge and pull |
| 47 | + |
| 48 | +Merge the PR, and pull the changes locally (using the commands in the first |
| 49 | +step). Ensure that `chore(multiple): x.y.z release proposal` is the most recent |
| 50 | +commit. |
| 51 | + |
| 52 | +## Publish the GitHub Release |
| 53 | + |
| 54 | +Publish the GitHub release, ensuring that the tag points to the newly landed |
| 55 | +commit corresponding to release proposal `x.y.z`. |
| 56 | + |
| 57 | +## NPM publish happens automatically via CircleCI |
| 58 | + |
| 59 | +Publishing the GitHub release will cause the release commit to be tagged as |
| 60 | +`vx.y.z`, which triggers a CircleCI `publish_npm` job that automatically |
| 61 | +publishes the packages to NPM. See the |
| 62 | +[OpenCensus Web CircleCI config][oc-web-circleci-url] |
| 63 | + |
| 64 | +## Update CHANGELOG and release versions in examples |
| 65 | +* After releasing, you need to update all examples to the latest version. |
| 66 | +* In addition, update the CHANGELOG.md and start new Unreleased label. |
| 67 | +* Create a new commit with the exact title: `Post Release: update CHANGELOG, Examples and ReadMe`. |
| 68 | +* Go through PR review and merge it to GitHub master branch. |
| 69 | + |
| 70 | +[semver-url]: https://semver.org/ |
| 71 | +[github-releases-url]: https://github.com/census-instrumentation/opencensus-web/releases |
| 72 | +[oc-web-circleci-url]: https://github.com/census-instrumentation/opencensus-web/blob/master/.circleci/config.yml |
0 commit comments