# Release Strategy

## Regular Release (version `X.Y.Z`)

1. Create a branch off of `develop` named `vX.Y.Z`
1. On `vX.Y.Z`, update package version in package.json to `X.Y.Z` and update `CHANGELOG.md` with latest changes (may need to look at closed PRs).
1. Commit & push changes:
    ```bash
    # on `vX.Y.Z` branch
    $ git commit -am "vX.Y.Z" && git push --set-upstream origin vX.Y.Z
    ```
1. Open two PRs named `vX.Y.Z` – set the base of one to `master` and the other to `develop`
1. Rebase `vX.Y.Z` with `master` (this will ensure that what we release into QA is what we will be releasing into production)
1. **[Release `vX.Y.Z` to the QA Environment](#qa-release-branch-feature-foo)**
1. Make any bug fixes to `vX.Y.Z` and continue releasing to the QA environment until you get the ✅.
1. Once given the 👍 to release, **FIRST** merge the changes into `master` (**DO NOT** delete the branch). Then rebase the remaining PR with `develop`, merge & delete the branch.
1. Draft and **[publish a release](https://github.com/equitysim/simulation-platform/releases)** off of `master` with the changelog as the update notes.


## Hotfix Release (version `X.Y.Z`)
1. Create a branch off of `master` named `hotfix-<branch name>`
1. Apply fix to `hotfix-<branch name>`, commit and push.
1. Bump the patch version in `package.json`, add a commit with the new version number `"vX.Y.Z"`.
1. Open two PRs for the changes – set the base of one to `master` and the other to`develop`.
1. Once given the 👍 (by a reviewer), **FIRST** merge the changes into `master` (**DO NOT** delete the branch). Then rebase the remaining PR with `develop`, merge & delete the branch.
1. Draft and **[publish a patch release](https://github.com/equitysim/simulation-platform/releases)** off of `master` with the changelog as the update notes.

## QA Release (branch `feature-foo`)
1. Ensure you have `feature-foo` up-to-date and pushed to the repository
1. Reset qa branch:
    ```
    # on `qa` branch
    $ git reset --hard origin/feature-foo && git push -f
    ```
