Skip to content

Commit 0d219c7

Browse files
ci: fix updating Chrome (#10382)
1 parent b332675 commit 0d219c7

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

.github/workflows/issue-analyzer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
with:
6161
node-version: lts/*
6262
- name: Install dependencies
63-
run: npm install
63+
run: npm ci
6464
- name: Analyze issue
6565
id: issue-analysis
6666
run: echo $ISSUE_BODY | ./tools/analyze_issue.mjs >> $GITHUB_OUTPUT

.github/workflows/pre-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
2727
- name: Install dependencies
28-
run: npm install
28+
run: npm ci
2929
- name: Build
3030
env:
3131
PUBLISH: 1
@@ -34,7 +34,7 @@ jobs:
3434
- name: Version docs
3535
working-directory: ./website
3636
run: |
37-
npm install
37+
npm ci
3838
npm run docusaurus docs:version $(jq -r .version ../packages/puppeteer/package.json)
3939
npm run archive
4040
- name: Re-build docs after versioning
@@ -44,6 +44,7 @@ jobs:
4444
npm run docs
4545
- name: Format
4646
run: npm run format
47+
# Release-please does not update the package-lock
4748
- name: Install to refresh package-lock
4849
run: npm install
4950
- name: Commit

tools/update_chrome_revision.mjs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,29 @@ async function updateDevToolsProtocolVersion(revision) {
110110
);
111111
}
112112

113-
async function updateVersionFileLastMaintained(currentVersion, updateVersion) {
113+
async function updateVersionFileLastMaintained(oldVersion, newVersion) {
114114
const versions = [...versionsPerRelease.keys()];
115-
if (versions.indexOf(updateVersion) !== -1) {
115+
if (versions.indexOf(newVersion) !== -1) {
116116
return;
117117
}
118118

119119
// If we have manually rolled Chrome but not yet released
120120
// We will have NEXT as value in the Map
121-
if (versionsPerRelease.get(currentVersion) === 'NEXT') {
122-
await replaceInFile('./versions.js', currentVersion, updateVersion);
123-
} else {
124-
await replaceInFile(
125-
'./versions.js',
126-
VERSIONS_PER_RELEASE_COMMENT,
127-
`${VERSIONS_PER_RELEASE_COMMENT}\n ['${version}', 'NEXT'],`
128-
);
121+
if (versionsPerRelease.get(oldVersion) === 'NEXT') {
122+
await replaceInFile('./versions.js', oldVersion, newVersion);
123+
return;
124+
}
125+
126+
await replaceInFile(
127+
'./versions.js',
128+
VERSIONS_PER_RELEASE_COMMENT,
129+
`${VERSIONS_PER_RELEASE_COMMENT}\n ['${version}', 'NEXT'],`
130+
);
131+
132+
const oldSemVer = new SemVer(oldVersion, true);
133+
const newSemVer = new SemVer(newVersion, true);
129134

135+
if (newSemVer.compareMain(oldSemVer) !== 0) {
130136
const lastMaintainedIndex = versions.indexOf(lastMaintainedChromeVersion);
131137
const nextMaintainedVersion = versions[lastMaintainedIndex - 1];
132138

0 commit comments

Comments
 (0)