Skip to content

Commit 0abb5ef

Browse files
authored
build: use semantic commits to get next version (#14851)
1 parent aef9fac commit 0abb5ef

File tree

12 files changed

+193
-166
lines changed

12 files changed

+193
-166
lines changed

DEPLOY.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ You can build the Cypress binary locally by running `yarn binary-build`. You can
4343
- Ensure you have the following permissions set up:
4444
- An AWS account with permission to create AWS access keys for the Cypress CDN.
4545
- Permissions for your npm account to publish the `cypress` package.
46-
- Permissions to modify environment variables for `cypress` on CircleCI and AppVeyor.
4746
- Permissions to update releases in ZenHub.
4847

4948
- Set up the following environment variables:
@@ -142,11 +141,10 @@ In the following instructions, "X.Y.Z" is used to denote the version of Cypress
142141
npm dist-tag add [email protected]
143142
```
144143
145-
9. Run `binary-release` to update the [download server's manifest](https://download.cypress.io/desktop.json) and set the next CI version:
144+
9. Run `binary-release` to update the [download server's manifest](https://download.cypress.io/desktop.json):
146145
```shell
147146
yarn run binary-release --version X.Y.Z
148147
```
149-
> Note: Currently, there is an [issue setting the next CI version](https://github.com/cypress-io/cypress/issues/7176) that will cause this command to fail after setting the download manifest. You will need to manually update NEXT_DEV_VERSION by logging in to CircleCI and AppVeyor. This is noted in Step 16 below.
150148
151149
10. If needed, push out any updated changes to the links manifest to [`on.cypress.io`](https://github.com/cypress-io/cypress-services/tree/develop/packages/on).
152150
@@ -185,9 +183,7 @@ In the following instructions, "X.Y.Z" is used to denote the version of Cypress
185183
186184
16. Publish a new docker image in [`cypress-docker-images`](https://github.com/cypress-io/cypress-docker-images) under `included` for the new cypress version.
187185
188-
17. Decide on the next version that we will work on. For example, if we have just released `3.7.0` we probably will work on `3.7.1` next. Set it on [CI machines](#set-next-version-on-cis).
189-
190-
18. Update example projects to the new version. For most projects, you can go to the Renovate dependency issue and check the box next to `Update 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:
186+
17. Update example projects to the new version. For most projects, you can go to the Renovate dependency issue and check the box next to `Update 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:
191187
- [cypress-example-todomvc](https://github.com/cypress-io/cypress-example-todomvc/issues/99)
192188
- [cypress-example-todomvc-redux](https://github.com/cypress-io/cypress-example-todomvc-redux/issues/1)
193189
- [cypress-example-realworld](https://github.com/cypress-io/cypress-example-realworld/issues/2)
@@ -199,7 +195,7 @@ In the following instructions, "X.Y.Z" is used to denote the version of Cypress
199195
- [cypress-documentation](https://github.com/cypress-io/cypress-documentation/issues/1313)
200196
- [cypress-example-docker-compose](https://github.com/cypress-io/cypress-example-docker-compose) - Doesn't have a Renovate issue, but will auto-create and auto-merge non-major Cypress updates as long as the tests pass.
201197
202-
19. Check if any test or example repositories have a branch for testing the features or fixes from the newly published version `x.y.z`. The branch should also be named `x.y.z`. Check all `cypress-test-*` and `cypress-example-*` repositories, and if there is a branch named `x.y.z`, merge it into `master`.
198+
18. Check if any test or example repositories have a branch for testing the features or fixes from the newly published version `x.y.z`. The branch should also be named `x.y.z`. Check all `cypress-test-*` and `cypress-example-*` repositories, and if there is a branch named `x.y.z`, merge it into `master`.
203199
204200
**Test Repos**
205201

appveyor.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ branches:
22
only:
33
- master
44
- develop
5-
- revert-create-cypress-tests
5+
- sem-next-ver
66
- /win*/
77

88
# https://www.appveyor.com/docs/lang/nodejs-iojs/
@@ -54,7 +54,6 @@ install:
5454
- node --version
5555
- node --print process.arch
5656
- yarn --version
57-
- yarn check-next-dev-version
5857
# prints all public variables relevant to the build
5958
- print-env Platform
6059
- yarn check-node-version
@@ -89,8 +88,8 @@ test_script:
8988
# make sure our snapshots are compared correctly
9089
# - npm run test-mocha-snapshot
9190
# the other larger tests
92-
- echo *** Building Windows NPM package %NEXT_DEV_VERSION% ***
93-
- npm --no-git-tag-version version %NEXT_DEV_VERSION%
91+
- echo *** Building Windows NPM package ***
92+
- yarn get-next-version --npm
9493
- cd cli
9594
- yarn
9695
- yarn build

circle.yml

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ macBuildFilters: &macBuildFilters
88
branches:
99
only:
1010
- develop
11-
- v6.0-release
12-
- include-electron-node-version
11+
- sem-next-ver
1312

1413
defaults: &defaults
1514
parallelism: 1
@@ -36,7 +35,7 @@ testBinaryFirefox: &testBinaryFirefox
3635
branches:
3736
only:
3837
- develop
39-
- v6.0-release
38+
- sem-next-ver
4039
requires:
4140
- build-npm-package
4241
- build-binary
@@ -231,7 +230,7 @@ commands:
231230

232231
clone-repo-and-checkout-release-branch:
233232
description: |
234-
Clones an external repo and then checks out the branch that matches NEXT_DEV_VERSION otherwise uses 'master' branch.
233+
Clones an external repo and then checks out the branch that matches the next version otherwise uses 'master' branch.
235234
parameters:
236235
repo:
237236
description: "Name of the github repo to clone like: cypress-example-kitchensink"
@@ -244,7 +243,7 @@ commands:
244243
name: "Cloning test project: <<parameters.repo>>"
245244
command: |
246245
git clone --depth 1 --no-single-branch https://github.com/cypress-io/<<parameters.repo>>.git /tmp/<<parameters.repo>>
247-
cd /tmp/<<parameters.repo>> && (git checkout $NEXT_DEV_VERSION || true)
246+
cd /tmp/<<parameters.repo>> && (git checkout $(node ./scripts/get-next-version) || true)
248247
249248
test-binary-against-repo:
250249
description: |
@@ -1028,13 +1027,10 @@ jobs:
10281027
DEBUG: electron-builder,electron-osx-sign*
10291028
# notarization on Mac can take a while
10301029
no_output_timeout: "45m"
1031-
# if this is a forked pull request, the NEXT_DEV_VERSION environment variable
1032-
# won't be set and we will use default version, since we are not going to
1033-
# upload the dev binary build anywhere
10341030
command: |
10351031
. ./scripts/load-nvm.sh
10361032
node --version
1037-
yarn binary-build --platform $PLATFORM --version ${NEXT_DEV_VERSION:-0.0.0-development}
1033+
yarn binary-build --platform $PLATFORM --version $(node ./scripts/get-next-version)
10381034
- run:
10391035
name: Zip the binary
10401036
command: |
@@ -1060,7 +1056,7 @@ jobs:
10601056
command: |
10611057
node scripts/binary.js upload-unique-binary \
10621058
--file cypress.zip \
1063-
--version $NEXT_DEV_VERSION
1059+
--version $(node ./scripts/get-next-version)
10641060
- run: cat binary-url.json
10651061
- store-npm-logs
10661062
- persist_to_workspace:
@@ -1139,14 +1135,9 @@ jobs:
11391135
at: ~/
11401136
- check-conditional-ci
11411137
- install-required-node
1142-
- run:
1143-
name: Check next dev version
1144-
command: |
1145-
. ./scripts/load-nvm.sh
1146-
yarn check-next-dev-version
11471138
- run:
11481139
name: bump NPM version
1149-
command: yarn version --no-git-tag-version --new-version ${NEXT_DEV_VERSION:-0.0.0-development}
1140+
command: yarn get-next-version --npm
11501141
- run:
11511142
name: build NPM package
11521143
command: |
@@ -1168,8 +1159,8 @@ jobs:
11681159
command: ls -l
11691160
# created file should have filename cypress-<version>.tgz
11701161
- run: mkdir /tmp/urls
1171-
- run: cp cli/build/cypress-v${NEXT_DEV_VERSION:-0.0.0-development}.tgz cypress.tgz
1172-
- run: cp cli/build/cypress-v${NEXT_DEV_VERSION:-0.0.0-development}.tgz /tmp/urls/cypress.tgz
1162+
- run: cp cli/build/cypress-v*.tgz cypress.tgz
1163+
- run: cp cli/build/cypress-v*.tgz /tmp/urls/cypress.tgz
11731164
- run: ls -l /tmp/urls
11741165
- store-npm-logs
11751166
- run: pwd
@@ -1192,7 +1183,7 @@ jobs:
11921183
command: |
11931184
node scripts/binary.js upload-npm-package \
11941185
--file cypress.tgz \
1195-
--version $NEXT_DEV_VERSION
1186+
--version $(node ./scripts/get-next-version)
11961187
- store-npm-logs
11971188
- run: ls -l
11981189
- run: cat npm-package-url.json
@@ -1817,7 +1808,7 @@ linux-workflow: &linux-workflow
18171808
branches:
18181809
only:
18191810
- develop
1820-
- v6.0-release
1811+
- sem-next-ver
18211812
requires:
18221813
- build
18231814
- test-kitchensink:
@@ -1835,7 +1826,7 @@ linux-workflow: &linux-workflow
18351826
branches:
18361827
only:
18371828
- develop
1838-
- v6.0-release
1829+
- sem-next-ver
18391830
requires:
18401831
- build
18411832
- build-npm-package:
@@ -1847,7 +1838,7 @@ linux-workflow: &linux-workflow
18471838
branches:
18481839
only:
18491840
- develop
1850-
- v6.0-release
1841+
- sem-next-ver
18511842
requires:
18521843
- build-npm-package
18531844
- build-binary:
@@ -1859,7 +1850,7 @@ linux-workflow: &linux-workflow
18591850
branches:
18601851
only:
18611852
- develop
1862-
- v6.0-release
1853+
- sem-next-ver
18631854
requires:
18641855
- build-binary
18651856
- test-npm-module-on-minimum-node-version:
@@ -1916,7 +1907,7 @@ linux-workflow: &linux-workflow
19161907
branches:
19171908
only:
19181909
- develop
1919-
- v6.0-release
1910+
- sem-next-ver
19201911
requires:
19211912
- upload-npm-package
19221913
- upload-binary
@@ -1926,7 +1917,7 @@ linux-workflow: &linux-workflow
19261917
branches:
19271918
only:
19281919
- develop
1929-
- v6.0-release
1920+
- sem-next-ver
19301921
requires:
19311922
- upload-npm-package
19321923
- upload-binary
@@ -1935,7 +1926,7 @@ linux-workflow: &linux-workflow
19351926
branches:
19361927
only:
19371928
- develop
1938-
- v6.0-release
1929+
- sem-next-ver
19391930
requires:
19401931
- build-npm-package
19411932
- build-binary
@@ -1945,7 +1936,7 @@ linux-workflow: &linux-workflow
19451936
branches:
19461937
only:
19471938
- develop
1948-
- v6.0-release
1939+
- sem-next-ver
19491940
requires:
19501941
- build-npm-package
19511942
- build-binary
@@ -1971,7 +1962,7 @@ linux-workflow: &linux-workflow
19711962
branches:
19721963
only:
19731964
- develop
1974-
- v6.0-release
1965+
- sem-next-ver
19751966
requires:
19761967
- build-npm-package
19771968
- build-binary
@@ -2065,7 +2056,7 @@ mac-workflow: &mac-workflow
20652056
branches:
20662057
only:
20672058
- develop
2068-
- v6.0-release
2059+
- sem-next-ver
20692060
requires:
20702061
- Mac NPM package
20712062
- Mac binary
@@ -2078,7 +2069,7 @@ mac-workflow: &mac-workflow
20782069
branches:
20792070
only:
20802071
- develop
2081-
- v6.0-release
2072+
- sem-next-ver
20822073
requires:
20832074
- Mac NPM package upload
20842075
- Mac binary upload
@@ -2091,7 +2082,7 @@ mac-workflow: &mac-workflow
20912082
branches:
20922083
only:
20932084
- develop
2094-
- v6.0-release
2085+
- sem-next-ver
20952086
requires:
20962087
- Mac NPM package upload
20972088
- Mac binary upload

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"build": "lerna run build --stream",
1515
"build-prod": "lerna run build-prod --stream",
1616
"bump": "node ./scripts/binary.js bump",
17-
"check-next-dev-version": "node scripts/check-next-dev-version.js",
1817
"check-node-version": "node scripts/check-node-version.js",
1918
"check-terminal": "node scripts/check-terminal.js",
2019
"clean": "lerna run clean --parallel",
@@ -34,14 +33,14 @@
3433
"docker": "./scripts/run-docker-local.sh",
3534
"effective:circle:config": "circleci config process circle.yml | sed /^#/d",
3635
"ensure-deps": "./scripts/ensure-dependencies.sh",
36+
"get-next-version": "node scripts/get-next-version.js",
3737
"postinstall": "./scripts/run-if-not-ci.sh yarn build",
3838
"jscodeshift": "jscodeshift -t ./node_modules/js-codemod/transforms/arrow-function-arguments.js",
3939
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json .",
4040
"lint-changed": "lint-changed",
4141
"move-binaries": "node ./scripts/binary.js move-binaries",
4242
"npm-release": "node scripts/npm-release.js",
4343
"semantic-release": "node ./scripts/semantic-release.js",
44-
"set-next-ci-version": "node ./scripts/binary.js setNextVersion",
4544
"prestart": "yarn ensure-deps",
4645
"start": "node $(yarn bin cypress) open --dev --global",
4746
"stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,src,__snapshots__ --exclude e2e.ts,cypress-tests.ts,unwritten.spec.ts",
@@ -118,6 +117,7 @@
118117
"check-dependencies": "1.1.0",
119118
"check-more-types": "2.24.0",
120119
"common-tags": "1.8.0",
120+
"conventional-recommended-bump": "6.1.0",
121121
"debug": "4.3.1",
122122
"del": "3.0.0",
123123
"electron-builder": "22.9.1",

packages/server/test/support/helpers/performance.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ function track (type, data) {
3030
type,
3131
data: {
3232
'package.json Version': pkg.version,
33-
'Next Version': process.env.NEXT_DEV_VERSION,
3433
'Commit SHA': sha,
3534
'Commit Branch': branch,
3635
'Commit Author': author,

scripts/binary/ask.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ let fs = require('fs-extra')
33
let glob = require('glob')
44
const Promise = require('bluebird')
55
const inquirer = require('inquirer')
6-
const path = require('path')
76

87
glob = Promise.promisify(glob)
98

@@ -85,32 +84,6 @@ const getReleases = (releases) => {
8584
}]
8685
}
8786

88-
const getNextVersion = function ({ version } = {}) {
89-
if (!version) {
90-
({
91-
version,
92-
} = require(path.join(__dirname, '..', '..', 'package.json')))
93-
}
94-
95-
const message = `Bump next version to...? (currently: ${version})`
96-
const defaultVersion = function () {
97-
const a = version.split('.')
98-
let v = a[a.length - 1]
99-
100-
v = Number(v) + 1
101-
a.splice(a.length - 1, 1, v)
102-
103-
return a.join('.')
104-
}
105-
106-
return [{
107-
name: 'nextVersion',
108-
type: 'input',
109-
message,
110-
default: defaultVersion,
111-
}]
112-
}
113-
11487
const getVersions = (releases) => {
11588
return [{
11689
name: 'version',
@@ -213,11 +186,6 @@ const whichBumpTask = () => {
213186
.get('task')
214187
}
215188

216-
const nextVersion = (version) => {
217-
return prompt(getNextVersion(version))
218-
.get('nextVersion')
219-
}
220-
221189
const toCommit = ({ version }) => {
222190
return prompt(getCommitVersion(version))
223191
.get('commit')
@@ -232,11 +200,9 @@ module.exports = {
232200
getVersions,
233201
getBumpTasks,
234202
deployNewVersion,
235-
nextVersion,
236203
whichZipFile,
237204
whichVersion,
238205
whichRelease,
239206
whichPlatform,
240207
whichBumpTask,
241-
242208
}

0 commit comments

Comments
 (0)