Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ orbs:
setup: true
version: 2.1

parameters:
publish-binary-branch:
type: string
default: main

workflows:
setup-workflow:
jobs:
Expand Down Expand Up @@ -152,7 +157,8 @@ jobs:
exit 1
fi
- continuation/continue:
configuration_path: .circleci/packed/pipeline.yml
configuration_path: .circleci/packed/pipeline.yml
parameters: '{ "publish-binary-branch": << pipeline.parameters.publish-binary-branch >> }'



Expand Down
21 changes: 7 additions & 14 deletions .circleci/src/pipeline/@pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ base-internal-minimum-node: &base-internal-minimum-node cypress/base-internal:20
ubuntu-2004-current: &ubuntu-2004-current ubuntu-2004:2024.11.1
ubuntu-2004-older: &ubuntu-2004-older ubuntu-2004:2024.05.1

parameters:
publish-binary-branch:
type: string
default: main

orbs:
browser-tools: circleci/[email protected]

Expand Down Expand Up @@ -1365,19 +1370,6 @@ commands:
paths:
- cypress/cypress.zip

trigger-publish-binary-pipeline:
steps:
- run:
name: "Trigger publish-binary pipeline"
command: |
source ./scripts/ensure-node.sh
echo $SHOULD_PERSIST_ARTIFACTS
node ./scripts/binary/trigger-publish-binary-pipeline.js
- persist_to_workspace:
root: ~/
paths:
- triggered_pipeline.json

build-cypress-npm-package:
parameters:
executor:
Expand Down Expand Up @@ -2473,7 +2465,8 @@ jobs:
- restore_cached_workspace
- check-if-binary-exists
- setup_should_persist_artifacts
- trigger-publish-binary-pipeline
- trigger-publish-binary-pipeline:
target-repo-branch: << pipeline.parameters.publish-binary-branch >>

get-published-artifacts:
<<: *defaults
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
parameters:
target-repo-branch:
type: string
default: main

steps:
- run:
name: Trigger publish-binary pipeline
command: |
if [[ -z "$CIRCLE_TOKEN" ]] || \
[[ -z "$CIRCLE_SHA1" ]] || \
[[ -z "$CIRCLE_JOB" ]] || \
[[ -z "$CIRCLE_WORKFLOW_ID" ]] || \
[[ -z "$CIRCLE_BUILD_URL" ]] || \
[[ -z "$CIRCLE_BRANCH" ]]; then

echo "Missing required environment variables. Skipping pipeline trigger."
exit 1
fi
if [[ -n "$SHOULD_PERSIST_ARTIFACTS" && "$SHOULD_PERSIST_ARTIFACTS" != "true" && "$SHOULD_PERSIST_ARTIFACTS" != "false" ]]; then
echo "SHOULD_PERSIST_ARTIFACTS must be true, false, or undefined. Skipping pipeline trigger."
exit 1
fi
if [[ -z $(which node) ]] || [[ -z $(which curl) ]] || [[ -z $(which jq) ]]; then
echo "Missing required commands. Skipping pipeline trigger. Ensure: jo, jq, curl, node are installed."
exit 1
fi
echo "Determining next binary version..."
export NEXT_VERSION=$(node ./scripts/get-next-version.js)
if [[ $? != 0 ]]; then
echo "Failed to determine next binary version. Skipping pipeline trigger."
exit 1
fi
echo "Next binary version: $NEXT_VERSION"
export BODY=$(cat \<<JSON_BODY_EOF
{
"branch": "<< parameters.target-repo-branch >>",
"parameters": {
"temp_dir": "${TMPDIR:-/tmp}",
"sha": "$CIRCLE_SHA1",
"job_name": "$CIRCLE_JOB",
"triggered_workflow_id": "$CIRCLE_WORKFLOW_ID",
"triggered_job_url": "$CIRCLE_BUILD_URL",
"branch": "$CIRCLE_BRANCH",
"should_persist_artifacts": ${SHOULD_PERSIST_ARTIFACTS:-false},
"binary_version": "$NEXT_VERSION"
}
}
JSON_BODY_EOF
)
if [[ $? != 0 ]]; then
echo "Failed to compose the request body. Skipping pipeline trigger."
exit 1
fi

echo "Triggering new pipeline in cypress-publish-binary project on branch << parameters.target-repo-branch >>..."
curl -X POST \
-o ~/triggered_pipeline.json \
-H "Circle-Token: $CIRCLE_TOKEN" \
-H "Content-Type: application/json" \
-d "$BODY" \
https://circleci.com/api/v2/project/github/cypress-io/cypress-publish-binary/pipeline

if [[ $? != 0 ]]; then
echo "Failed to trigger new pipeline. Skipping pipeline trigger."
exit 1
fi

echo "Pipeline saved to triggered_pipeline.json"
echo "Triggered pipeline: https://app.circleci.com/pipelines/github/cypress-io/cypress-publish-binary/$(jq -r '.number' triggered_pipeline.json)"
- persist_to_workspace:
root: ~/
paths:
- triggered_pipeline.json
5 changes: 2 additions & 3 deletions packages/electron/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ Upgrading `electron` involves more than just bumping this package's `package.jso
- [ ] Update `electron` version in `package.json`
- [ ] Update the target `electron` version in the circle configuration
- [ ] Update the docker image to the new browsers-internal image made in the previous step
- [ ] Temporarily update the circle configuration to allow `cypress` to run against the branch
- [ ] Temporarily set target `cypress-publish-binary` branch as a `branch` property on the request body in [../../scripts/binary/trigger-publish-binary-pipeline.js](../../scripts/binary/trigger-publish-binary-pipeline.js) script, so that you can test against this branch from the electron upgrade branch. This property must be set both at the root of the body object, and on the `parameters` key. If it is not set at the root, the binary pipeline will continue to use the primary branch.

- [ ] Add your branch name to the `&full-workflow-filters` anchor in [`@pipeline.yml`](../../.circleci/src/pipeline/@pipeline.yml)
Copy link
Contributor Author

@cacieprins cacieprins Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be parameterized as well (separately, to reduce delta surface)

- [ ] Trigger the pipeline in CircleCI's UI, and set the `publish-binary-branch` parameter to the branch you created in the `cypress-publish-binary` repository.

- [ ] **Manually smoke test `cypress open`.** Upgrading Electron can break the `desktop-gui` in unexpected ways. Since testing in this area is weak, double-check that things like launching `cypress open`, signing into Cypress Cloud, and launching Electron tests still work.
- [ ] **Manually smoke test `cypress run` in record mode** Upgrading Electron can cause `better-sqlite3` to SIGSEGV the Electron process.
Expand Down
47 changes: 0 additions & 47 deletions scripts/binary/trigger-publish-binary-pipeline.js

This file was deleted.

Loading