Files
cypress/.github/workflows/update-browser-versions.yml
T
Ryan Manuel 9fda261dde chore: upgrade electron to 32.2.0 (#30394)
* chore: upgrade electron to 32.2.0 -- run ci

* fix node versions

* fix build

* fix evil-dns

* various fixes

* fix srcdoc

* various fixes

* update package.json

* update yarn.lock

* various fixes

* fix integrity check

* fix binary verification

* various fixes

* update yarn.lock

* fix typo

* fix lock file

* fix tests

* fix tests

* various fixes

* various fixes

* various fixes

* fix stuff

* fix things

* try to fix errors

* fix

* updates

* add yarn berry

* upgrade electron

* attempt with gcc

* blank

* update arm64 executor

* try to fix the arm64 issue

* fix arm64

* bump cache

* attempt to fix arm64 again

* attempt to fix arm64 again

* fix darwin problems

* merge release/14.0.0

* update yarn.lock

* blank -- run ci

* blank

* blank

* blank

* try something

* try something

* clean up

* blank

* try to fix sessions issue

* fixes

* get more info

* get more info

* try something

* fix

* try something

* try something

* try something

* tweak

* one more thing

* let us see if this works

* blank

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* Apply suggestions from code review

* Apply suggestions from code review

* Update cli/CHANGELOG.md

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>

* Update cli/CHANGELOG.md

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>

* Update CHANGELOG.md

* Update cache-version.txt

* fix nx (maybe)

* Update package.json

* try something

* Update packages/app/src/runner/aut-iframe.ts

* bump version

* try to bust cache

* try to invalidate cache

* Update cli/CHANGELOG.md

* suppress benign warnings

* Apply suggestions from code review

* PR comments

* PR comment

* Apply suggestions from code review

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* Update cli/CHANGELOG.md

Co-authored-by: Matt Schile <mschile@cypress.io>

* update debug scenario 4 regex

* Update scripts/binary/trigger-publish-binary-pipeline.js

---------

Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Matt Schile <mschile@cypress.io>
2024-10-29 14:55:26 -05:00

127 lines
5.9 KiB
YAML

name: Update Browser Versions
on:
workflow_dispatch:
schedule:
- cron: '0 8 * * *' # every day at 8am UTC (3/4am EST/EDT)
jobs:
update-browser-versions:
runs-on: ubuntu-latest
env:
CYPRESS_BOT_APP_ID: ${{ secrets.CYPRESS_BOT_APP_ID }}
BASE_BRANCH: develop
# Prevent from running this workflow on forks
if: github.repository == 'cypress-io/cypress'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_GITHUB_ACTION_TOKEN }}
- name: Set committer info
## attribute the commit to cypress-bot: https://github.community/t/logging-into-git-as-a-github-app/115916
run: |
git config --local user.email "${{ env.CYPRESS_BOT_APP_ID }}+cypress-bot[bot]@users.noreply.github.com"
git config --local user.name "cypress-bot[bot]"
- name: Checkout base branch
run: |
git fetch origin
git checkout ${{ env.BASE_BRANCH }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Check for new Chrome versions
id: get-versions
uses: actions/github-script@v7
with:
script: |
const { getVersions } = require('./scripts/github-actions/update-browser-versions.js')
getVersions({ core })
- name: Determine name of new branch and if it already exists
id: check-branch
env:
BRANCH_NAME: update-chrome-stable-from-${{ steps.get-versions.outputs.current_stable_version }}-beta-from-${{ steps.get-versions.outputs.current_beta_version }}
run: |
echo "branch_name=${{ env.BRANCH_NAME }}" >> $GITHUB_OUTPUT
echo "branch_exists=$(git show-ref --verify --quiet refs/remotes/origin/${{ env.BRANCH_NAME }} && echo 'true')" >> $GITHUB_OUTPUT
- name: Check need for PR or branch update
id: check-need-for-pr
run: |
echo "needs_pr=${{ steps.get-versions.outputs.has_update == 'true' && steps.check-branch.outputs.branch_exists != 'true' }}" >> $GITHUB_OUTPUT
echo "needs_branch_update=${{ steps.get-versions.outputs.has_update == 'true' && steps.check-branch.outputs.branch_exists == 'true' }}" >> $GITHUB_OUTPUT
## Update available and a branch/PR already exists
- name: Checkout existing branch
if: ${{ steps.check-need-for-pr.outputs.needs_branch_update == 'true' }}
run: git checkout ${{ steps.check-branch.outputs.branch_name }}
- name: Check need for update on existing branch
if: ${{ steps.check-need-for-pr.outputs.needs_branch_update == 'true' }}
id: check-need-for-branch-update
uses: actions/github-script@v7
with:
script: |
const { checkNeedForBranchUpdate } = require('./scripts/github-actions/update-browser-versions.js')
checkNeedForBranchUpdate({
core,
latestStableVersion: '${{ steps.get-versions.outputs.latest_stable_version }}',
latestBetaVersion: '${{ steps.get-versions.outputs.latest_beta_version }}',
})
## Update available and a PR doesn't already exist
- name: Checkout new branch
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' }}
run: git checkout -b ${{ steps.check-branch.outputs.branch_name }} ${{ env.BASE_BRANCH }}
## Both
- name: Update Browser Versions File
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' || steps.check-need-for-branch-update.outputs.has_newer_update == 'true' }}
uses: actions/github-script@v7
with:
script: |
const { updateBrowserVersionsFile } = require('./scripts/github-actions/update-browser-versions.js')
updateBrowserVersionsFile({
latestStableVersion: '${{ steps.get-versions.outputs.latest_stable_version }}',
latestBetaVersion: '${{ steps.get-versions.outputs.latest_beta_version }}',
})
- name: Commit the changes
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' || steps.check-need-for-branch-update.outputs.has_newer_update == 'true' }}
run: |
git commit -am "chore: ${{ steps.get-versions.outputs.description }}"
- name: Push branch to remote
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' || steps.check-need-for-branch-update.outputs.has_newer_update == 'true' }}
run: git push origin ${{ steps.check-branch.outputs.branch_name }}
## Update available and a branch/PR already exists
- name: Update PR Title
if: ${{ steps.check-need-for-pr.outputs.needs_branch_update == 'true' }}
uses: actions/github-script@v7
with:
script: |
const { updatePRTitle } = require('./scripts/github-actions/update-browser-versions.js')
await updatePRTitle({
context,
github,
baseBranch: '${{ env.BASE_BRANCH }}',
branchName: '${{ steps.check-branch.outputs.branch_name }}',
description: '${{ steps.get-versions.outputs.description }}',
})
# Update available and a PR doesn't already exist
- name: Create Pull Request
id: create-pr
if: ${{ steps.check-need-for-pr.outputs.needs_pr == 'true' }}
uses: actions/github-script@v7
with:
script: |
const { createPullRequest } = require('./scripts/github-actions/create-pull-request.js')
await createPullRequest({
context,
github,
baseBranch: '${{ env.BASE_BRANCH }}',
branchName: '${{ steps.check-branch.outputs.branch_name }}',
description: '${{ steps.get-versions.outputs.description }}',
body: 'This PR was auto-generated to update the version(s) of Chrome for driver tests',
addToProjectBoard: true,
})