<commit_before># Releasing Habitat

This document contains step-by-step details for how to release Habitat. All components are released
from the master branch on a bi-weekly schedule occurring every other Thursday.

## Submit a Release Notes Blog Post PR

If one has not already been opened, create a "Release Notes" blog post PR. Add a file to the Habitat repo: `www/source/blog/2018-02-20-0540Release.html.md`. Of course you will change the date and version to match the reality that is manifesting itself in your present moment. This post should begin with the following structure:

```
---
title: Habitat <VERSION> Released
date: <yyyy-mm-dd>
author: <NAME>
tags: release notes
category: product
classes: body-article
---

Habitat <VERSION> Release Notes

We are happy to announce the release of Habitat <VERSION>. We have a number of new features as well as bug fixes, so please read on for all the details. If you just want the binaries, head on over to [Install Habitat](https://www.habitat.sh/docs/using-habitat/#install-habitat). Thanks again for using Habitat!

Highlights: 
* [BREAKING CHANGE] SOME BREAKING CHANGE
```

If you happen to be aware of features or bugs and feel there are user impacting words that need to be expressed, this is your opportunity to express them. Tasha will finalize and publish this PR after the release process is complete.

**Important:** Filter all closed PRs labeled `C-breaking` and ensure any and all of these PRs is mentioned as a `[BREAKING CHANGE]` in the post highlights.

## Prepare Master Branch for Release

1. Clone the Habitat repository if you do not already have it

    ```
    $ git clone <EMAIL>:habitat-sh/habitat.git ~/habitat
    ```

1. Ensure you are on the master branch and have the latest of `~/habitat`

    ```
    $ cd ~/habitat
    $ git checkout master
    $ git pull origin master
    ```

1. Create a new release branch in the Habitat repo

    ```
    $ cd ~/habitat
    $ git checkout -b <branch>
    ```

1. Remove the `-dev` suffix from the version number found in the `VERSION` file

    ```
    $ sed -i '' -e 's/-dev//' VERSION
    ```

1. Generate a new `CHANGELOG.md`

    ```
    $ export GITHUB_TOKEN=<<PASSWORD>-token>
    $ make changelog
    ```

The changelog generator will only process the last 1000 issues to prevent the generator from exceeding Github's rate limit threshold. This may produce a truncated changelog. If so, simply copy the last release in the generated changelog and paste it on top of the former changelog. Terrible we know but we have a better plan coming!

1. Commit the `CHANGELOG.md` and `VERSION` changes and push your branch
1. Issue a new PR await approval (in the form of a [dank gif](http://imgur.com/X0sNq)) from two maintainers
1. Pull master once again once the PR is merged into master
1. Create & push a Git tag

    ```
    $ make tag-release
    $ git push origin --tags
    ```

Once the release tag is pushed, Travis and Appveyor builds will be triggered that will upload all release binaries to a channel named `rc-[VERSION]` and the hab cli will be uploaded BUT not published to the `stable` bintray repository. These builds can take nearly an hour to fully complete. Keep an eye on them so we can validate the binaries when they finish.

## Validate the Release

For each platform, download the latest stable cli version from [Bintray](https://bintray.com/habitat/stable). These can be downloaded from the version files page but are unpublished so that our download page does not yet include them. There may be special behavior related to this release that you will want to validate but at the very least, run `hab studio enter` and make sure:<commit_msg>add note to release doc about killing non release builds after tag push<commit_after># Releasing Habitat

This document contains step-by-step details for how to release Habitat. All components are released
from the master branch on a bi-weekly schedule occurring every other Thursday.

## Submit a Release Notes Blog Post PR

If one has not already been opened, create a "Release Notes" blog post PR. Add a file to the Habitat repo: `www/source/blog/2018-02-20-0540Release.html.md`. Of course you will change the date and version to match the reality that is manifesting itself in your present moment. This post should begin with the following structure:

```
---
title: Habitat <VERSION> Released
date: <yyyy-mm-dd>
author: <NAME>
tags: release notes
category: product
classes: body-article
---

Habitat <VERSION> Release Notes

We are happy to announce the release of Habitat <VERSION>. We have a number of new features as well as bug fixes, so please read on for all the details. If you just want the binaries, head on over to [Install Habitat](https://www.habitat.sh/docs/using-habitat/#install-habitat). Thanks again for using Habitat!

Highlights: 
* [BREAKING CHANGE] SOME BREAKING CHANGE
```

If you happen to be aware of features or bugs and feel there are user impacting words that need to be expressed, this is your opportunity to express them. Tasha will finalize and publish this PR after the release process is complete.

**Important:** Filter all closed PRs labeled `C-breaking` and ensure any and all of these PRs is mentioned as a `[BREAKING CHANGE]` in the post highlights.

## Prepare Master Branch for Release

1. Clone the Habitat repository if you do not already have it

    ```
    $ git clone git@github.com:habitat-sh/habitat.git ~/habitat
    ```

1. Ensure you are on the master branch and have the latest of `~/habitat`

    ```
    $ cd ~/habitat
    $ git checkout master
    $ git pull origin master
    ```

1. Create a new release branch in the Habitat repo

    ```
    $ cd ~/habitat
    $ git checkout -b <branch>
    ```

1. Remove the `-dev` suffix from the version number found in the `VERSION` file

    ```
    $ sed -i '' -e 's/-dev//' VERSION
    ```

1. Generate a new `CHANGELOG.md`

    ```
    $ export GITHUB_TOKEN=<your-token>
    $ make changelog
    ```

The changelog generator will only process the last 1000 issues to prevent the generator from exceeding Github's rate limit threshold. This may produce a truncated changelog. If so, simply copy the last release in the generated changelog and paste it on top of the former changelog. Terrible we know but we have a better plan coming!

1. Commit the `CHANGELOG.md` and `VERSION` changes and push your branch
1. Issue a new PR await approval (in the form of a [dank gif](http://imgur.com/X0sNq)) from two maintainers
1. Pull master once again once the PR is merged into master
1. Create & push a Git tag

    ```
    $ make tag-release
    $ git push origin --tags
    ```

Once the release tag is pushed, Travis and Appveyor builds will be triggered on the release tag. There is currently a bug where if multiple mac builds are running concurrently, one build can possibly delete some hab keys needed by the other. Until this is propperly addressed, **kill any travis builds running that are NOT part of the release tag build**.

The release tag builds will upload all release binaries to a channel named `rc-[VERSION]` and the hab cli will be uploaded BUT not published to the `stable` bintray repository. These builds can take nearly an hour to fully complete. Keep an eye on them so we can validate the binaries when they finish.

## Validate the Release

For each platform, download the latest stable cli version from [Bintray](https://bintray.com/habitat/stable). These can be downloaded from the version files page but are unpublished so that our download page does not yet include them. There may be special behavior related to this release that you will want to validate but at the very least, run `hab studio enter` and make sure:
{'fraction_non_alphanumeric': 0.0676497218988488, 'fraction_numerical': 0.006726167378088216, 'mean_word_length': 3.7003039513677813, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7334370', 'n_tokens_mistral': 2121, 'n_tokens_neox': 2043, 'n_words': 1158}