# Astro Release Process

## Overview

The Astro project is spread across several repositories on Github:

| Repository | Description |
|---|---|---|
| `astro`           | Core Astro repository containing the js, ios, and Android code. |
| `astro-scaffold`  | Astro scaffold project for quickly starting a new Astro project.|
| `astro-tutorial`  | The starting point for the Astro Tutorial.|
| `generator-astro` | A script that automates starting a new project using the scaffold as a basis. |

The scaffold and tutorial repositories reference Astro using NPM. They track
Astro at the MAJOR and MINOR level, but will always use the latest PATCH release.
Because of this, when releasing only a PATCH update for Astro, the scaffold and tutorial don't need to be re-released.

The generator points to the `master` branch of Astro so will always generate a project using the latest release.

## Naming

All MAJOR+MINOR Astro releases are named. The person who does the release gets to pick the
name. Currently all Astro releases are named after a islands in BC (note that we don't
include the word "island" in the name, so if you pick Hornby Island for the release
we would call the release "Astro v0.8.0 - Hornby"). To see which island names we've already
used check the [releases page](https://github.com/mobify/astro/releases).

You can find a full list of islands here: https://en.wikipedia.org/wiki/List_of_islands_of_British_Columbia

# Release Checklist

Use this release checklist when releasing a new version of Astro. Ensure they are followed in order.
Paste everything after the line into your Astro release pull request. It might also make things
easier to print out this checklist and then work through it on paper.

-----

**Release Name**: _________________________________

**Version**: ________________________________

- [ ] All tests are passing
    + BuddyBuild iOS on `develop` branch (JavaScript tests are run during this build as well)
    + BuddyBuild Android on `develop` branch
- [ ] Determine the version number for the `mobify-progressive-app-sdk`, `astro-scaffold`, `astro-tutorial`,
      and `generator-astro` releases.
      They should all have matching versions, and follow [SEMVER](http://semver.org/).

      *Note:* Patches do not require a new docs release.

## Astro SDK
- [ ] Branch off of `develop` and create a `release-vX.Y.Z` branch.
- [ ] Create a new pull request with the following settings:
      * Base: `master`
      * Compare: `release-vX.Y.Z`
      Paste the contents of this checklist into this pull request.
- [ ] Run `scripts/release.sh`. This script is in beta and does a bunch of the (previously manual) version changes required. Use the checklist below to verify that the script worked or perform the updates yourself if necessary.
    - [ ] Increment the version in `package.json` (note that it may be specified as 'X.Y-dev' for testing, be sure to remove the '-dev' suffix).
    - [ ] Update the docs for this new version. The script does the following things:
        - Copies the `docs/public/dev` folder to `docs/public/X.Y` (for major/minor releases only, not patch).
        - Updates both `docs/public/X.Y/` and `docs/public/dev/` to point to the current version:
          - Points to the version of `astro-client.js` that was published to the CDN.
          - Points the `git clone`s to the version of `astro-tutorial` that we will release.
          - Updates `currentVersion` in `docs/harp.json` to point to new docs version directory.
          - Add the previous `currentVersion` in `docs/public/_data.json`
          - Update the `docs/public/latest` symlink to point at `docs/public/X.Y`
          - Update `docs/public/index.jade` with the `currentVersion` ("We have just released...")
- [ ] In the CHANGELOG.md file of this release branch, change the 'To be released' header to 'vX.Y.Z (January 1, 2017)'. (Use "today's" date in brackets behind the version number)
- [ ] Merge `release-vX.Y.Z` into `master` using the pull request. This will [publish a new version to npm and the CDN](https://github.com/mobify/astro#publishing-a-new-version). (**don't delete the `release-vX.Y.Z` branch yet!!**).
- [ ] Draft a new Github release with the following settings:
      * Tag version: `X.Y.Z` @ `release-vX.Y.Z`
      * Release title: `X.Y.Z - <island_name>`
      * Description: Use highlights from the CHANGELOG.md (only pick out the most significant changes)
      * This is a pre-release: ✓
- [ ] Merge `master` into `develop` (no need for pull request, just merge).
- [ ] Ensure the new version of docs was automatically deployed (this should happen with the CircleCI build of `develop` after the merge).
- [ ] Create a branch off of `develop` (like `post-vX.Y.Z-updates`).
    - [ ] In the CHANGELOG.md file of the `develop` branch, add a new header to the top of the file:

        ```
        ## To be released
        ```

    - [ ] Change the version number in `package.json` to `X.Y.Z-dev` (whatever the next version will
          be plus a `-dev` suffix).
    - [ ] Merge back to `develop` (no need for PR or reviews as the changes are just book-keeping)

## Astro Tutorial

*Note: The easiest way to manage this is to work through this list twice from top to bottom, once for the scaffold
and once for the tutorial.*

- [ ] Branch off `develop` and create a `release-vX.Y.Z` branch.
- [ ] Create a new pull request with the following settings:
      * Base: `master`
      * Compare: `release-vX.Y.Z`
- [ ] Update the version of the `mobify-progressive-app-sdk` npm module in `package.json`.
- [ ] Make necessary changes to make it compatible with the release branch in
    `mobify-progressive-app-sdk`.
- [ ] In the CHANGELOG.md file of this release branch, change the 'To be released' header to 'vX.Y'.
- [ ] Merge `release-vX.Y.Z` into `master` using the pull request (**don't delete the `release-vX.Y.Z` branch yet!!**).
- [ ] Draft a new Github release with the following setings:
      * Tag version: `X.Y.Z` @ `release-vX.Y.Z`
      * Release title: `Release coinciding with Astro vX.Y.Z`
      * Description: Use highlights from changelog (sometimes it is just "Updating to point to vX.Y.Z of Astro")
      * This is a pre-release: ✓
- [ ] Merge `master` into `develop` (no pull request needed, just merge).
- [ ] In the CHANGELOG.md file of the `develop` branch, add a new header to the top of the file:

      ```
      ## To be released
      ```

## Cleanup
- [ ] Delete all of the `release-vX.Y.Z` branches that were created.
