Skip to content

Commit

Permalink
Merge pull request #1650 from Seneca-CDOT/issue1632
Browse files Browse the repository at this point in the history
[Documentation] Fixes #1632: Updated release documentation
  • Loading branch information
HyperTHD authored Feb 10, 2021
2 parents 9b5fb39 + 909731e commit 8edf4c5
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,35 @@ try to keep this document up-to-date to reflect our current practices.

In order for the automated release process to work, you must do the following:

- create an `upstream` remote for Telescope to which you can push
- create a [personal access token on GitHub](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) for the SenecaCDOT/telescope repo. You only need to grant "repo" access, not "admin" or other scopes. _NOTE: keep this private, don't add to git_
- add your access token to your `.env` file using the `GITHUB_TOKEN` variable
- have admin rights to [the Telescope repository on GitHub](https://github.com/Seneca-CDOT/telescope)
- set up an `upstream` remote pointing to [Telescope](https://github.com/Seneca-CDOT/telescope) on your machine

## Create a Release

When we release Telescope, we need to do a number of things:

- run our linters, tests, and make sure the code is working as best we can
- set a new version number in `package.json`
- generate a changelog
- create a new release commit, git tag, and push to our upstream GitHub repo
- generate a changelog
- create a Release on GitHub

To help automate this process, we use the [release-it](https://www.npmjs.com/package/release-it) command line tool.
We use the [npm-version](https://docs.npmjs.com/cli/v6/commands/npm-version) command line tool to help us automate the release process.

### Using release-it
### Using npm-version

To create a new release, follow these steps:

1. Make sure you've done everything in the Setup section above, including your `GITHUB_TOKEN`.
1. Make sure your `master` branch is up-to-date, and you have the most recent git tags in your repo: `git pull upstream master --tags`.
1. Run `npm outdated` to see a report of [outdated npm packages](https://docs.npmjs.com/cli-commands/outdated.html). Examine this list and decide whether we need to update
anything now, or before the next release. _Please file a new Issue to update
anything that is outdated_.
1. Determine what the new version number should be based on [semantic versioning](https://docs.npmjs.com/about-semantic-versioning).
1. Use `npm run release` to actually do the full release

As part of the process, [release-it](https://www.npmjs.com/package/release-it) will
perform a number of checks, and fail if anything isn't right. For example, your
working directory must be clean (no local file changes), you must have an `upstream`
remote, the tests must pass, etc.

### Releases
1. Make sure your working tree is clean.
1. Determine what the new version _string_ should be based on [semantic versioning](https://github.com/npm/node-semver#functions). New version should be a valid semver string. In our project, that would usually be `minor` (e.g. `1.5.0`, `1.6.0`, `1.7.0`) or `major` (e.g. `1.0.0`, `2.0.0`). See [npm-version docs](https://docs.npmjs.com/cli/v6/commands/npm-version) to learn more about what options are available for the new version string.
1. Use `npm version <new-version-string> -m "Release message"` to trigger the automated release workflow. For example, `npm version minor -m "Release 1.6.0"` will increase the minor version of the project (`1.5.x` -> `1.6.0`). To make a major release, we can use `npm version major -m "Release 2.0.0"` (`1.x.x` to `2.0.0`).

Once a release is complete, a new [git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) will be created in the project's history. A new
[GitHub Release will also be created](https://github.com/Seneca-CDOT/telescope/releases).
`npm-version` will proceed to run tests locally. If successful, it will also bump the `version` in [package.json](https://github.com/Seneca-CDOT/telescope/blob/master/package.json), create a new [`git tag`](https://git-scm.com/book/en/v2/Git-Basics-Tagging) and push both the code and the tags to `upstream master` (which you should have configured to point to https://github.com/Seneca-CDOT/telescope at this point).
That will trigger our [release workflow](https://github.com/Seneca-CDOT/telescope/blob/master/.github/workflows/release.yml), which will run all tests in the cloud. If tests finish successfully, [the release workflow](https://github.com/Seneca-CDOT/telescope/blob/master/.github/workflows/release.yml) will proceed to [generate a changelog](https://github.com/lob/generate-changelog#usage) and create a new [GitHub Release](https://github.com/Seneca-CDOT/telescope/releases).

## Domains

Expand Down

0 comments on commit 8edf4c5

Please sign in to comment.