Skip to content

Commit

Permalink
Merge branch 'develop' into update-chrome-stable-from-98.0.4758.80-be…
Browse files Browse the repository at this point in the history
…ta-from-98.0.4758.80
  • Loading branch information
Blue F committed Feb 7, 2022
2 parents 74e964e + 589f93b commit 2a4154c
Show file tree
Hide file tree
Showing 23 changed files with 403 additions and 648 deletions.
9 changes: 0 additions & 9 deletions __snapshots__/upload-npm-package-spec.js

This file was deleted.

26 changes: 0 additions & 26 deletions __snapshots__/upload-unique-binary-spec.js

This file was deleted.

Binary file added assets/cypress-bot-pre-release-comment.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 21 additions & 35 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mainBuildFilters: &mainBuildFilters
only:
- develop
- 10.0-release
- node-17-maybe
- fix-ci-artifact-uploads

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand Down Expand Up @@ -525,10 +525,6 @@ commands:
post-install-comment:
description: Post GitHub comment with a blurb on how to install pre-release version
steps:
- run: ls -la
- run: ls -la binary-url.json npm-package-url.json
- run: cat binary-url.json
- run: cat npm-package-url.json
- run:
name: Post pre-release install comment
command: |
Expand Down Expand Up @@ -862,6 +858,7 @@ commands:
echo "Not code signing for this platform"
fi
- run:
name: Build the Cypress binary
environment:
DEBUG: electron-builder,electron-osx-sign*
# notarization on Mac can take a while
Expand All @@ -871,42 +868,25 @@ commands:
yarn binary-build --platform $PLATFORM --version $(node ./scripts/get-next-version.js)
- run:
name: Zip the binary
command: |
yarn binary-zip --platform $PLATFORM
command: yarn binary-zip --platform $PLATFORM
- store-npm-logs
- persist_to_workspace:
root: ~/
paths:
- cypress/cypress.zip

upload-binary:
steps:
- run:
name: upload unique binary
command: |
node scripts/binary.js upload-unique-binary \
--file cypress.zip \
--version $(node -p "require('./package.json').version")
- run: cat binary-url.json
- store-npm-logs
- persist_to_workspace:
root: ~/
paths:
- cypress/binary-url.json

build-cypress-npm-package:
parameters:
executor:
type: executor
default: cy-doc
steps:
- run:
name: bump NPM version
name: Bump NPM version
command: yarn get-next-version --npm
- run:
name: build NPM package
command: |
yarn build --scope cypress
name: Build NPM package
command: yarn build --scope cypress
- run:
command: ls -la types
working_directory: cli/build
Expand All @@ -925,27 +905,36 @@ commands:
name: list created NPM package
command: ls -l
- store-npm-logs
- run: pwd
- persist_to_workspace:
root: ~/
paths:
- cypress/cypress.tgz

upload-npm-package:
upload-build-artifacts:
steps:
- run: ls -l
- run:
name: upload NPM package
name: Upload unique binary to S3
command: |
node scripts/binary.js upload-npm-package \
node scripts/binary.js upload-build-artifact \
--type binary \
--file cypress.zip \
--version $(node -p "require('./package.json').version")
- run:
name: Upload NPM package to S3
command: |
node scripts/binary.js upload-build-artifact \
--type npm-package \
--file cypress.tgz \
--version $(node -p "require('./package.json').version")
- store-npm-logs
- run: ls -l
- run: cat binary-url.json
- run: cat npm-package-url.json
- persist_to_workspace:
root: ~/
paths:
- cypress/binary-url.json
- cypress/npm-package-url.json

jobs:
Expand Down Expand Up @@ -1587,12 +1576,11 @@ jobs:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "node-17-maybe" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "fix-ci-artifact-uploads" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
- upload-binary
- upload-npm-package
- upload-build-artifacts
- post-install-comment

test-kitchensink:
Expand Down Expand Up @@ -2128,7 +2116,6 @@ linux-workflow: &linux-workflow
- runner-ct-integration-tests-chrome:
requires:
- build

- desktop-gui-integration-tests-7x:
requires:
- build
Expand Down Expand Up @@ -2190,7 +2177,6 @@ linux-workflow: &linux-workflow
- npm-react
- npm-mount-utils
- npm-vue
- npm-design-system
- npm-webpack-batteries-included-preprocessor
- npm-webpack-preprocessor
- npm-vite-dev-server
Expand Down
2 changes: 1 addition & 1 deletion cli/lib/tasks/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const getVersionSpecifier = (startDir = path.resolve(__dirname, '../..')) => {
})
}

const betaNpmUrlRe = /^\/beta\/npm\/(?<version>[0-9.]+)\/(?<artifactSlug>.+?)\/cypress\.tgz$/
const betaNpmUrlRe = /^\/beta\/npm\/(?<version>[0-9.]+)\/(?<platformSlug>.+?)\/(?<artifactSlug>.+?)\/cypress\.tgz$/

// convert a prerelease NPM package .tgz URL to the corresponding binary .zip URL
const getBinaryUrlFromPrereleaseNpmUrl = (npmUrl) => {
Expand Down
6 changes: 3 additions & 3 deletions cli/test/lib/tasks/install_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,13 @@ describe('/lib/tasks/install', function () {
})

it('returns binary url for prerelease npm url', function () {
expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/ciprovider-branchname-sha/cypress.tgz'))
expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/linux-x64/ciprovider-branchname-sha/cypress.tgz'))
.to.eq('https://cdn.cypress.io/beta/binary/5.1.1/linux-x64/ciprovider-branchname-sha/cypress.zip')

expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/circle-develop-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz'))
expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/inux-x64/circle-develop-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz'))
.to.eq('https://cdn.cypress.io/beta/binary/5.1.1/linux-x64/circle-develop-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.zip')

expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/circle-develop/some/branch-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz'))
expect(install._getBinaryUrlFromPrereleaseNpmUrl('https://cdn.cypress.io/beta/npm/5.1.1/inux-x64/circle-develop/some/branch-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.tgz'))
.to.eq('https://cdn.cypress.io/beta/binary/5.1.1/linux-x64/circle-develop/some/branch-3fdfc3b453eb38ad3c0b079531e4dde6668e3dd0-436710/cypress.zip')
})

Expand Down
17 changes: 6 additions & 11 deletions guides/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,7 @@ of Cypress. You can see the progress of the test projects by opening the status

![Screenshot of status checks](https://i.imgur.com/AsQwzgO.png)

#### :bangbang: Important :bangbang:

The `linux x64`, `win32 x64`, and `darwin x64` artifacts produced by CI are all placed in the same directory on the CDN. The version that was built last will overwrite the other versions in the directory. Until work is done to complete [#19771](https://github.com/cypress-io/cypress/issues/19771), you must ensure that the `linux` workflow publishes its artifacts **after** the `windows`/`mac` workflows. To guarantee this, you can re-run the `create-build-artifacts` job for the `linux` workflow within CircleCI after the initial builds have completed.

<img src="https://user-images.githubusercontent.com/1711637/150612076-ac1d233b-519a-443b-9fd4-950a8f0439ef.png" width="250" height="auto">

Once the `develop` branch for all test projects are reliably passing with the new changes and the `linux` binary is present at `https://cdn.cypress.io/beta/npm/X.Y.Z/<sha>/cypress.tgz`, publishing can proceed.
Once the `develop` branch for all test projects are reliably passing with the new changes and the `linux-x64` binary is present at `https://cdn.cypress.io/beta/binary/X.Y.Z/linux-x64/<sha>/cypress.zip`, and the `linux-x64` cypress npm package is present at `https://cdn.cypress.io/beta/binary/X.Y.Z/linux-x64/<sha>/cypress.tgz`, publishing can proceed.

### Steps to Publish a New Version

Expand All @@ -93,14 +87,15 @@ In the following instructions, "X.Y.Z" is used to denote the [next version of Cy
- To find the link to the package file `cypress.tgz`:
1. In GitHub, go to the latest commit (the one whose sha you used in the last step).
![commit-link](https://user-images.githubusercontent.com/1157043/80608728-33fe6100-8a05-11ea-8b53-375303757b67.png)
2. Scroll down past the changes to the comments. The first comment should be a `cypress-bot` comment that includes a line beginning `npm install ...`. Grab the `https://cdn.../npm/X.Y.Z/<long sha>/cypress.tgz` link.
![cdn-tgz-link](https://user-images.githubusercontent.com/1157043/80608736-3791e800-8a05-11ea-8d75-e4f80128e857.png)
- Make sure the linux binaries are present at that location. See [Before Publishing a New Version](#before-publishing-a-new-version).
- Publish to the npm registry straight from the URL:
2. Scroll down past the changes to the comments. The first comment should be a `cypress-bot` comment that includes a line beginning `npm install ...`. Grab the `https://cdn.../npm/X.Y.Z/<platform>/<long sha>/cypress.tgz` link.
![commit-bot-comment](../assets/cypress-bot-pre-release-comment.png)
- Make sure the `linux-x64` binary and npm package are present at the commented locations. See [Before Publishing a New Version](#before-publishing-a-new-version).
- Publish the `linux-x64` distribution to the npm registry straight from the URL:

```shell
npm publish https://cdn.cypress.io/beta/npm/X.Y.Z/<long sha>/cypress.tgz --tag dev
```
:bangbang: Important :bangbang: Be sure to release the `linux-x64` distribution.

5. Double-check that the new version has been published under the `dev` tag using `npm info cypress` or [available-versions](https://github.com/bahmutov/available-versions). `latest` should still point to the previous version. Example output:

Expand Down
5 changes: 0 additions & 5 deletions packages/server/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@
"eventsource": "1.0.7",
"express-session": "1.16.1",
"express-useragent": "1.0.15",
"http-mitm-proxy": "0.7.0",
"https-proxy-agent": "3.0.1",
"istanbul": "0.4.5",
"mocha": "7.1.0",
Expand Down
33 changes: 18 additions & 15 deletions scripts/binary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const meta = require('./meta')
const build = require('./build')
const upload = require('./upload')
const uploadUtils = require('./util/upload')
const { uploadNpmPackage } = require('./upload-npm-package')
const { uploadUniqueBinary } = require('./upload-unique-binary')
const { uploadArtifactToS3 } = require('./upload-build-artifact')
const { moveBinaries } = require('./move-binaries')

// initialize on existing repo
Expand Down Expand Up @@ -252,18 +251,11 @@ const deploy = {
})
},

// upload Cypress NPM package file
'upload-npm-package' (args = process.argv) {
console.log('#packageUpload')
// upload Cypress binary or NPM Package zip file under unique hash
'upload-build-artifact' (args = process.argv) {
console.log('#uploadBuildArtifact')

return uploadNpmPackage(args)
},

// upload Cypress binary zip file under unique hash
'upload-unique-binary' (args = process.argv) {
console.log('#uniqueBinaryUpload')

return uploadUniqueBinary(args)
return uploadArtifactToS3(args)
},

// uploads a single built Cypress binary ZIP file
Expand All @@ -288,10 +280,21 @@ const deploy = {
console.log('for platform %s version %s',
options.platform, options.version)

return upload.toS3({
zipFile: options.zip,
const uploadPath = upload.getFullUploadPath({
version: options.version,
platform: options.platform,
name: upload.zipName,
})

return upload.toS3({
file: options.zip,
uploadPath,
}).then(() => {
return uploadUtils.purgeDesktopAppFromCache({
version: options.version,
platform: options.platform,
zipName: options.zip,
})
})
})
},
Expand Down
10 changes: 6 additions & 4 deletions scripts/binary/move-binaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import confirm from 'inquirer-confirm'
import uploadUtils from './util/upload'

// @ts-ignore
import { getUploadDirForPlatform } from './upload-unique-binary'
import { getUploadDirForPlatform } from './upload-build-artifact'
// @ts-ignore
import { zipName, getFullUploadName } from './upload'
import { zipName, getFullUploadPath } from './upload'

/**
* 40 character full sha commit string
Expand Down Expand Up @@ -160,7 +160,9 @@ export const moveBinaries = async (args = []) => {

const uploadDir = getUploadDirForPlatform({
version: releaseOptions.version,
}, platformArch)
uploadFolder: 'binary',
platformArch,
})

console.log('finding binary for %s in %s', platformArch, uploadDir)

Expand Down Expand Up @@ -216,7 +218,7 @@ export const moveBinaries = async (args = []) => {
platformArch: lastBuild.platformArch,
name: zipName,
}
const destinationPath = getFullUploadName(options)
const destinationPath = getFullUploadPath(options)

console.log('copying test runner %s to %s', lastBuild.platformArch, destinationPath)

Expand Down

0 comments on commit 2a4154c

Please sign in to comment.