1 | # Release Process
|
2 |
|
3 | Although not very tricky, it is quite easy to deploy something that doesn't
|
4 | quite work as expected. The following steps help you navigate through some of
|
5 | the release gotchas and will hopefully result in a successful release.
|
6 |
|
7 | ---
|
8 |
|
9 | ## Preparation
|
10 |
|
11 | ### Communication
|
12 |
|
13 | - Ensure that homu isn't presently processing any PRs.
|
14 | - Post a note in [#dev-ember-cli](https://discordapp.com/channels/480462759797063690/480501885837770763) letting us know you're doing a release.
|
15 |
|
16 | > I'm starting an Ember CLI release. Please hold off merging PRs and pushing new code!
|
17 |
|
18 | ### Environment
|
19 |
|
20 | Make sure that you're running the most recent stable `node` and bundled `npm`.
|
21 |
|
22 | ```sh
|
23 | node --version
|
24 | npm --version
|
25 | ```
|
26 |
|
27 | ## Branching
|
28 |
|
29 | If you're planning to release a stable/bugfix version _and_ a beta, make sure to release the beta _after_ the stable version.
|
30 |
|
31 | ```sh
|
32 | # Fetch changes from GitHub
|
33 | git fetch origin
|
34 | ```
|
35 |
|
36 | Once you're done following these instructions make sure that you push your `master`, `beta`, and `release` branches back to GitHub.
|
37 |
|
38 |
|
39 | ### Promoting beta to stable
|
40 |
|
41 | Follow these steps if you're releasing a new minor or major version (e.g. from `v2.5.0` to `v2.6.0`):
|
42 |
|
43 | ```sh
|
44 | # Switch to "release" branch and reset it to "origin/beta"
|
45 | git checkout -B release --track origin/beta
|
46 |
|
47 | # Merge any unmerged changes from "origin/release" back in
|
48 | git merge origin/release
|
49 |
|
50 | # ... do the stable release ...
|
51 |
|
52 | # Switch to "beta" branch and reset it to "origin/beta"
|
53 | git checkout -B beta --track origin/beta
|
54 |
|
55 | # Merge the new stable release into the "beta" branch
|
56 | git merge vX.Y.0
|
57 | ```
|
58 |
|
59 | ### Stable bugfix release
|
60 |
|
61 | Follow these steps if you're releasing a bugfix for a stable version (e.g. from `v2.5.0` to `v2.5.1`)
|
62 |
|
63 | ```sh
|
64 | # Switch to "release" branch and reset it to "origin/release"
|
65 | git checkout -B release --track origin/release
|
66 |
|
67 | # ... do the stable release ...
|
68 |
|
69 | # Switch to "beta" branch and reset it to "origin/beta"
|
70 | git checkout -B beta --track origin/beta
|
71 |
|
72 | # Merge the new stable release into the "beta" branch
|
73 | git merge vX.Y.Z
|
74 | ```
|
75 |
|
76 |
|
77 | ### Promoting canary to beta
|
78 |
|
79 | Follow these steps if you're releasing a beta version after a new minor/major release (e.g. `v2.7.0-beta.1`)
|
80 |
|
81 | ```sh
|
82 | # Switch to "beta" branch and reset it to "origin/master"
|
83 | git checkout -B beta --track origin/master
|
84 |
|
85 | # Merge any unmerged changes from "origin/beta" back in
|
86 | git merge origin/beta
|
87 |
|
88 | # ... do the beta release ...
|
89 |
|
90 | # Switch to "master" branch and reset it to "origin/master"
|
91 | git checkout -B master --track origin/master
|
92 |
|
93 | # Merge the new beta release into the "master" branch
|
94 | git merge vX.Y.0-beta.1
|
95 |
|
96 | # Push back upstream.
|
97 | git push origin
|
98 | ```
|
99 |
|
100 |
|
101 | ### Incremental beta release
|
102 |
|
103 | Follow these steps if you're releasing a beta version following another beta (e.g. `v2.7.0-beta.N` with `N != 1`)
|
104 |
|
105 | ```sh
|
106 | # Switch to "beta" branch and reset it to "origin/beta"
|
107 | git checkout -B beta --track origin/beta
|
108 |
|
109 | # ... do the beta release ...
|
110 |
|
111 | # Switch to "master" branch and reset it to "origin/master"
|
112 | git checkout -B master --track origin/master
|
113 |
|
114 | # Merge the new beta release into the "master" branch
|
115 | git merge vX.Y.0-beta.N
|
116 | ```
|
117 |
|
118 | ## Release
|
119 |
|
120 | ### Setup
|
121 |
|
122 | * Update Ember and Ember Data versions.
|
123 | * `blueprints/app/files/package.json`
|
124 | * if you're releasing a new minor or major version:
|
125 | * `tests/fixtures/addon/npm/package.json`
|
126 | * `tests/fixtures/addon/yarn/package.json`
|
127 | * `tests/fixtures/app/npm/package.json`
|
128 | * `tests/fixtures/app/yarn/package.json`
|
129 | * generate changelog
|
130 | * if on master branch
|
131 | * run `./dev/changelog`
|
132 | * if this is a beta
|
133 | * run `./dev/changelog beta`
|
134 | * if this is a release
|
135 | * run `./dev/changelog release`
|
136 | * prepend changelog output to `CHANGELOG.md`
|
137 | * edit changelog output to be as user-friendly as possible (drop [INTERNAL] changes, non-code changes, etc.)
|
138 | * replace any "ember-cli" user references in the changelog to whomever made the change
|
139 | * bump `package.json` version
|
140 | * don't commit these changes until later
|
141 | * run `./dev/prepare-release`
|
142 | * the `du` command should give you ballbark 230K as of `3.0.0`
|
143 |
|
144 | ### Test
|
145 |
|
146 | * `cd to/someplace/to/test/`
|
147 | * ensure `ember version` is the newly packaged version
|
148 |
|
149 | ```shell
|
150 | # ensure new project generation works
|
151 | ember new --skip-npm my-cool-test-project
|
152 | cd my-cool-test-project
|
153 |
|
154 | # link your local ember-cli
|
155 | npm link ember-cli
|
156 |
|
157 | # install other deps
|
158 | npm install
|
159 |
|
160 | # test the server
|
161 | ember serve
|
162 | ```
|
163 |
|
164 | * test other things like generators and live-reload
|
165 | * generate an http mock `ember g http-mock my-http-mock`
|
166 | * test upgrades of other apps
|
167 | * if releasing using Windows, check that it works on a Linux VM
|
168 | * we are checking if any Windows line endings snuck in, because they won't work on Unix
|
169 | * if releasing using Unix, you are set, Windows can read your line endings
|
170 |
|
171 | ### Update Artifacts
|
172 |
|
173 | * if normal release
|
174 | * run `./dev/add-to-output-repos.sh`
|
175 | * if incremental beta release
|
176 | * run `./dev/add-to-output-repos.sh beta`
|
177 | * if promoting canary to beta
|
178 | * run `./dev/add-to-output-repos.sh beta fork`
|
179 | * copy the [`ember new` diff] and [`ember addon` diff] lines from the previous
|
180 | release changelog and paste into the current, then update the url with the
|
181 | newer tags
|
182 |
|
183 | ### Publish
|
184 |
|
185 | If everything went well, publish. Please note, we must have an extremely low
|
186 | tolerance for quirks and failures. We do not want our users to endure any extra
|
187 | pain.
|
188 |
|
189 | 1. go back to ember-cli directory
|
190 | * `git add` the modified `package.json` and `CHANGELOG.md`
|
191 | * Commit the changes `git commit -m "Release vx.y.z"` and push `git push`
|
192 | * `git tag "vx.y.z"`
|
193 | * `git push origin <vx.y.z>`
|
194 | * publish to npm
|
195 | * if normal release
|
196 | * `npm publish ./ember-cli-<version>.tgz`
|
197 | * if beta release
|
198 | * `npm publish ./ember-cli-<version>.tgz --tag beta`
|
199 |
|
200 |
|
201 | ### Test Again
|
202 |
|
203 | Test published version
|
204 |
|
205 | 1. `npm uninstall -g ember-cli`
|
206 | * `npm cache clear`
|
207 | * install
|
208 | * if normal release
|
209 | * `npm install -g ember-cli`
|
210 | * if beta release
|
211 | * `npm install -g ember-cli@beta`
|
212 | * ensure version is as expected `ember version`
|
213 | * ensure new project generates
|
214 | * ensure old project upgrades nicely
|
215 |
|
216 |
|
217 | ## Promote
|
218 |
|
219 | Announce release!
|
220 |
|
221 | ### Create a new release on GitHub
|
222 |
|
223 | * [Draft a new release.](https://github.com/ember-cli/ember-cli/releases/new)
|
224 | * enter the new version number as the tag prefixed with `v` e.g. (`v0.1.12`)
|
225 | * Make sure to include the links for diffs between the versions.
|
226 | * for release title choose a great name, no pressure
|
227 | * in the description paste the following upgrade instructions
|
228 |
|
229 | ```
|
230 | ## Setup
|
231 |
|
232 | `npm install -g ember-cli@NEW_VERSION_NUMBER` -- Install new global ember-cli
|
233 |
|
234 | ## Project Update
|
235 |
|
236 | 1. `rm -rf node_modules dist tmp` -- Delete temporary development folders.
|
237 | 2. `npm install -g ember-cli-update` -- Install Ember CLI update tool globally.
|
238 | 3. Run `ember-cli-update --to NEW_VERSION_NUMBER` -- This will update your app or addon to the latest ember-cli release. You will probably encounter merge conflicts that you should resolve in your normal git workflow.
|
239 | 4. Run `ember-cli-update --run-codemods` -- This will let you pick codemods to run against your project, to ensure you are using the latest patterns and platform features.
|
240 |
|
241 | ## Changelog
|
242 |
|
243 | INSERT_CHANGELOG_HERE
|
244 | ```
|
245 |
|
246 | * Fill in the version number for `NEW_VERSION_NUMBER`
|
247 | * Replace `INSERT_CHANGELOG_HERE` with the new content from `CHANGELOG.md`
|
248 | * Attach the `ember-cli-<version>.tgz` from above
|
249 | * Check the "Pre-release" checkbox for beta releases.
|
250 | * Publish the release.
|
251 |
|
252 | ### Twitter
|
253 |
|
254 | > Ember CLI vX.Y.Z "Release name goes here." released!
|
255 | https://github.com/ember-cli/ember-cli/releases/tag/vX.Y.Z
|
256 | \#emberjs
|
257 |
|
258 | ### Discord
|
259 |
|
260 | Grab a link to your tweet and post in:
|
261 | * [#news-and-announcements](https://discordapp.com/channels/480462759797063690/480499624663056390)
|
262 | * [#dev-ember-cli](https://discordapp.com/channels/480462759797063690/480501885837770763)
|
263 | * [#ember-cli](https://discordapp.com/channels/480462759797063690/486548111221719040)
|
264 |
|
265 |
|
266 | ## Troubleshooting
|
267 |
|
268 | * if a few mins after release you notice an issue, you can unpublish
|
269 | * `npm unpublish ember-cli@<version>` (`npm unpublish` is write-only, that is you can unpublish but cannot push `ember-cli` with the same version, you have to bump `version` in `package.json`)
|
270 | * if it is completely broken, feel free to unpublish a few hours later or the next morning, even if you don't have time to immediately rerelease
|