Although not very tricky, the Ember Data release process does have a few manual steps. The following steps navigate us through some of the release gotchas and will hopefully result in a successful release.
There are four release channels, lts
, release
, beta
and canary
.
Each has it's own section below.
In this guide, we are assuming that the remote origin
is [email protected]:emberjs/data.git
,
this remote needs to exist and origin/main
origin/beta
origin/release
etc. need to be the upstreams of the local main
beta
release
branches etc.
In order to release ember-data
you must first ensure the following things:
- You have
commit
rights toember-data
on GitHub - You have an account on
npm
and belongs to theember-data
organization on NPM - You have
publish
rights within theember-data
organization on NPM - You have configured your NPM account to use
2fa
(two factor authentication) - You have logged into your NPM account on your machine (typically sessions preserve nearly forever once you have)
- You have configured
GITHUB_AUTH
token forlerna-changelog
to be able to gather info for the release notes. - You have installed
pnpm
andnode
globally (or better, viavolta
)
When releasing more than one channel, we release from "most stable" to "least stable"
lts
(Most Stable)release
beta
canary
(Least Stable)
Once you have finished this release process, we recommend posting an announcement to Twitter the Crosslinking the announcement to the following Discord channels.
-
Checkout the correct branch
a. For the first release of a new
LTS
, create a new branch fromorigin/release
DO THIS PRIOR TO PUBLISHING THE NEXT RELEASE
git fetch origin; git checkout -b lts-<majorVersion>-<minorVersion> origin/release;
b. For subsequent releases of this
LTS
, ensure your local branch is in-sync with the remote.git fetch origin; git checkout lts-<majorVersion>-<minorVersion>; git reset --hard origin/lts-<majorVersion>-<minorVersion>;
-
Generate the Changelog
Note: If this is the first release of the LTS and there are no changes, just add an entry for the next patch version stating we are promoting the release to LTS.
The Changelog is generated with lerna-changelog.
The changelog is generated based on labels applied to PRs since the last release. These labels are configured in the root package.json
. Before merging PRs reviewers should always ensure a meaningful title for the changelog exists.
For the first release of an LTS, previous-version
will be the last released version of the release
channel: e.g. v4.8.1
For subsequent versions it will be whatever version number we previously published for this LTS.
To actually generate the changelog, run:
pnpm exec lerna-changelog --from=PREVIOUS_VERSION_TAG
Note: if it is the first time that you use lerna-changelog, you might have to add a token to fetch from Github API: https://github.com/lerna/lerna-changelog#github-token
Then:
- insert lerna-changelog output to
CHANGELOG.md
underneath the document title - commit the changelog and push the change upstream:
git add CHANGELOG.md;
git commit -m "Update Changelog for v<new-lts-version>"
git push origin lts-<majorVersion>-<minorVersion> // Note: alternatively, you can make a PR to lts-<majorVersion>-<minorVersion> to make sure there are no errors
-
Publish the LTS
node ./scripts/publish.js lts
-
Update the Release Notes on Github
- Visit Ember Data Releases
- Click on the "Tags"
- Click on the tag just published
- Edit the tag, adding a meaningful title and attaching the changelog (see other releases for examples)
- Publish the release!
-
Checkout the
release
branch and ensure it is in-sync withorigin/release
.DO NOT WORK FROM A LOCAL
release
branch THAT DIFFERSa. If this is the first
release
release of the cycle, we "cut" frombeta
.DO THIS PRIOR TO PUBLISHING THE NEXT BETA
git checkout release; git fetch origin; git reset --hard origin/beta; git push origin release -f;
b. For subsequent
release
releases during the cycle, we release from therelease
branch.git checkout release; git fetch origin; git reset --hard origin/release;
-
Generate the Changelog
IT IS IMPORTANT THAT ALL CHANGES ARE ON THE REMOTE BRANCH SPECIFIED BY HEAD
previous-version
will be whatever version we previously published as arelease
. E.g. if our last release was4.8.4
and now we are publishing4.9.0
then we would use--from=v4.8.4
pnpm exec lerna-changelog --from=PREVIOUS_VERSION_TAG
-
prepend a new section title for this version with Today's date to
CHANGELOG.md
-
insert changelog script output to
CHANGELOG.md
underneath this new section title -
edit changelog output to be as user-friendly as possible (drop [INTERNAL] changes, non-code changes, etc.)
-
commit the changelog and push the change upstream
git add CHANGELOG.md; git commit -m "Update Changelog for v<new-version>"; git push origin release;
-
Publish the release
node ./scripts/publish.js release
-
Update the Release Notes on Github
- Visit Ember Data Releases
- Click on the "more recent tags"
- Click on the tag just published
- Edit the tag, adding a meaningful title and attaching the changelog (see other releases for examples)
- Publish the release!
Note: Most Beta Releases should be handled by the
Canary-Mirror-Beta Release
workflow, which should be manually triggered from the actions page.
-
Checkout the
#beta
branch and ensure it is in-sync withorigin/beta
.DO NOT WORK FROM A LOCAL
beta
branch THAT DIFFERSa. If this is the first
beta
release of the cycle, we "cut" from#main
.DO THIS PRIOR TO PUBLISHING THE NEXT CANARY
git checkout beta; git fetch origin; git reset --hard origin/main; git push origin beta -f;
b. For subsequent
beta
releases during the cycle, we release from the beta branch.git checkout beta; git fetch origin; git reset --hard origin/beta;
-
Publish the weekly beta
node ./scripts/publish.js beta
-
Checkout the
#main
branch and ensure it is in-sync withorigin/main
.DO NOT WORK FROM A LOCAL
main
branch THAT DIFFERSgit checkout main; git fetch origin; git reset --hard origin/main
-
Publish the nightly.
a. If this is the very first
canary
release for a new minornode ./scripts/publish.js canary --bumpMinor
b. If this is the very first
canary
release for a new majornode ./scripts/publish.js canary --bumpMajor
c. For all other "nightly" canary releases
node ./scripts/publish.js canary
Congrats, you are finished!
New canary versions are published to npm every Tuesday and Friday at 12pm PST by the Alpha Release
GitHub action. They can also be published using the workflow trigger.
It will always increment the pre-release version of what's currently in the root package.json
. For example from 3.25.0-alpha.1
to 3.25.0-alpha.2
. It requires a human to manually bump minor and major versions and publish.
To try out the script that will be executed in the GitHub action, use:
node scripts/publish.js canary --dryRun --force --skipSmokeTest
. The --dryRun
param will skip auto committing the
version change and publishing.