These procedures concern the release process for the Cypress binary and cypress
npm module.
The @cypress/
-namespaced NPM packages that live inside the /npm
directory are automatically published to npm (with semantic-release
) upon being merged into develop
. You can read more about this in CONTRIBUTING.md.
Anyone can build the binary and npm package locally, but you can only deploy the Cypress application and publish the npm module cypress
if you are a member of the cypress
npm organization.
-
Ensure you have the following permissions set up:
- An AWS account with permission to access and write to the AWS S3, i.e. the Cypress CDN.
- Permissions for your npm account to publish the
cypress
package.
-
Set up an AWS SSO profile with the Team-CypressApp-Prod role. The release scripts assumes the name of your profile is
prod
. Make sure to open the "App Developer" expando for some necessary config values. Your AWS config file should end up looking like the following:[prod] sso_start_url = <start_url> sso_region = <region> aws_access_key_id = <access_key_id> aws_secret_access_key = <secret_access_key> aws_session_token = <session_token>
-
Set up the following environment variables:
-
For the
release-automations
step, you will need setup the following envs:- GitHub token - Found in 1Password.
- The
cypress-bot
GitHub app credentials. Found in 1Password.
GITHUB_TOKEN="..." GITHUB_APP_CYPRESS_INSTALLATION_ID= GITHUB_APP_ID= GITHUB_PRIVATE_KEY=
-
For purging the Cloudflare cache (needed for the
prepare-release-artifacts
script in step 6), you'll needCF_ZONEID
andCF_TOKEN
set. These can be found in 1Password.CF_ZONEID="..." CF_TOKEN="..."
-
If you don't have access to 1Password, ask a team member who has done a deploy.
Tip: Use as-a to manage environment variables for different situations.
In order to publish a new version of the cypress
package to the npm registry, CI must build and test it across multiple platforms and test projects. CI is set up to do the following on every commit to develop
:
- Build the npm package with the next target version baked in.
- Build the Linux, Mac & Windows binaries on CircleCI.
- Upload the binaries and the new npm package to the AWS S3 Bucket
cdn.cypress.io
under the "beta" folder. - Launch test projects using the newly-uploaded package & binary instead of installing from the npm registry.
Multiple test projects are launched for each target operating system and the results are reported back to GitHub using status checks so that you can see if a change has broken real-world usage of Cypress. You can see the progress of the test projects by opening the status checks on GitHub:
In the following instructions, "X.Y.Z" is used to denote the next version of Cypress being published.
-
Install and test the pre-release version to make sure everything is working.
- Get the pre-release version that matches your system from the latest develop commit.
- Install the new version:
npm install -g <cypress.tgz path>
- Run a quick, manual smoke test:
cypress open
- Go into a project, run a quick test, make sure things look right
- Optionally, install the new version into an established project and run the tests there
- cypress-realworld-app uses yarn and represents a typical consumer implementation.
- Optionally, do more thorough tests, for example test the new version of Cypress against the Cypress Cloud repo.
-
Ensure all changes to the links manifest to
on.cypress.io
have been merged todevelop
and deployed. -
Create a Release PR Bump, submit, get approvals on, and merge a new PR. This PR Should:
- Bump the Cypress
version
inpackage.json
- Bump the
packages/example
dependency if there is a newcypress-example-kitchensink
version - Follow the writing the Cypress Changelog release steps to update the
cli/CHANGELOG.md
.
- Bump the Cypress
-
Once the
develop
branch is passing in CI and you have confirmed thecypress-bot
has commented on the commit with the pre-release versions fordarwin-x64
,darwin-arm64
,linux-x64
,linux-arm64
, andwin32-x64
, publishing can proceed. -
Log into AWS SSO with
aws sso login --profile <name_of_profile>
. If you have setup your credentials under a different profile thanprod
, be sure to set theAWS_PROFILE
environment variable to that profile name for the remaining steps. For example, if you are usingproduction
instead ofprod
, doexport AWS_PROFILE=production
. -
Use the
prepare-release-artifacts
script (Mac/Linux only) to prepare the latest commit to a stable release. When you run this script, the following happens:- the binaries for
<commit sha>
are moved frombeta
to thedesktop
folder for<new target version>
in S3 - the Cloudflare cache for this version is purged
- the pre-prod
cypress.tgz
NPM package is converted to a stable NPM package ready for release
yarn prepare-release-artifacts --sha <commit sha> --version <new target version>
You can pass
--dry-run
to see the commands this would run under the hood. - the binaries for
-
Validate you are logged in to
npm
withnpm whoami
. Otherwise log in withnpm login
. -
Publish the generated npm package under the
dev
tag, using your personal npm account.npm publish /tmp/cypress-prod.tgz --tag dev
-
Double-check that the new version has been published under the
dev
tag usingnpm info cypress
or available-versions.latest
should still point to the previous version. Example output:dist-tags: dev: 3.4.0 latest: 3.3.2
-
Test
[email protected]
to make sure everything is working.- Install the new version:
npm install -g [email protected]
- Run a quick, manual smoke test:
cypress open
- Go into a project, run a quick test, make sure things look right
- Install the new version into an established project and run the tests there
- cypress-realworld-app uses yarn and represents a typical consumer implementation.
- Optionally, do more thorough tests, for example test the new version of Cypress against the Cypress Cloud repo.
- Install the new version:
-
Review the release-specific documentation and changelog PR in cypress-documentation. If there is not already a release-specific PR open, create one.
- Ensure the changelog is up-to-date and has the correct date.
- Merge any release-specific documentation changes into the main release PR.
- You can view the doc's branch deploy preview by clicking 'Details' on the PR's
netlify-cypress-docs/deploy-preview
GitHub status check.
-
Create a new docker image using the new cypress version in
cypress-docker-images
. Create a PR in which you update factory/.env to use the new cypress version. Ensure the docker image is reviewed and has passing tests before proceeding. -
Make the new npm version the "latest" version by updating the dist-tag
latest
to point to the new version:npm dist-tag add [email protected]
-
Run
binary-release
to update the download server's manifest. This will also ensure the binary for the version is downloadable for each system.yarn binary-release --version X.Y.Z
-
Merge the documentation PR from step 11 and the new docker image PR created in step 12 to release the image.
-
If needed, deploy the updated
cypress-example-kitchensink
toexample.cypress.io
by following these instructions under "Deployment". -
Once the release is complete, create a Github tag off of the release commit which bumped the version:
git checkout develop git pull origin develop git log --pretty=oneline # copy sha of the version bump commit git tag -a vX.Y.Z -m vX.Y.Z <sha> git push origin vX.Y.Z
-
Create a new GitHub release. Choose the tag you created previously and add contents to match previous releases.
-
Add a comment to each GH issue that has been resolved with the new published version. Download the
releaseData.json
artifact from theverify-release-readiness
CircleCI job and run the following command inside of cypress-io/release-automations:cd packages/issues-in-release && npm run do:comment -- --release-data <path_to_releaseData.json>
-
Confirm there are no issues from the release with the label stage: pending release left.
-
Check all
cypress-test-*
andcypress-example-*
repositories, and if there is a branch namedx.y.z
for testing the features or fixes from the newly published versionx.y.z
, update that branch to refer to the newly published NPM version inpackage.json
. Then, get the changes approved and merged into that project's main branch. For projects without ax.y.z
branch, you can go to the Renovate dependency issue and check the box next toUpdate dependency cypress to X.Y.Z
. It will automatically create a PR. Once it passes, you can merge it. Try updating at least the following projects:
Take a break, you deserve it! 👉😎👉