ci: fix updating Chrome (#10382)

This commit is contained in:
Nikolay Vitkov 2023-06-14 09:59:01 +02:00 committed by GitHub
parent b332675974
commit 0d219c79de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 13 deletions

View File

@ -60,7 +60,7 @@ jobs:
with:
node-version: lts/*
- name: Install dependencies
run: npm install
run: npm ci
- name: Analyze issue
id: issue-analysis
run: echo $ISSUE_BODY | ./tools/analyze_issue.mjs >> $GITHUB_OUTPUT

View File

@ -25,7 +25,7 @@ jobs:
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install dependencies
run: npm install
run: npm ci
- name: Build
env:
PUBLISH: 1
@ -34,7 +34,7 @@ jobs:
- name: Version docs
working-directory: ./website
run: |
npm install
npm ci
npm run docusaurus docs:version $(jq -r .version ../packages/puppeteer/package.json)
npm run archive
- name: Re-build docs after versioning
@ -44,6 +44,7 @@ jobs:
npm run docs
- name: Format
run: npm run format
# Release-please does not update the package-lock
- name: Install to refresh package-lock
run: npm install
- name: Commit

View File

@ -110,23 +110,29 @@ async function updateDevToolsProtocolVersion(revision) {
);
}
async function updateVersionFileLastMaintained(currentVersion, updateVersion) {
async function updateVersionFileLastMaintained(oldVersion, newVersion) {
const versions = [...versionsPerRelease.keys()];
if (versions.indexOf(updateVersion) !== -1) {
if (versions.indexOf(newVersion) !== -1) {
return;
}
// If we have manually rolled Chrome but not yet released
// We will have NEXT as value in the Map
if (versionsPerRelease.get(currentVersion) === 'NEXT') {
await replaceInFile('./versions.js', currentVersion, updateVersion);
} else {
if (versionsPerRelease.get(oldVersion) === 'NEXT') {
await replaceInFile('./versions.js', oldVersion, newVersion);
return;
}
await replaceInFile(
'./versions.js',
VERSIONS_PER_RELEASE_COMMENT,
`${VERSIONS_PER_RELEASE_COMMENT}\n ['${version}', 'NEXT'],`
);
const oldSemVer = new SemVer(oldVersion, true);
const newSemVer = new SemVer(newVersion, true);
if (newSemVer.compareMain(oldSemVer) !== 0) {
const lastMaintainedIndex = versions.indexOf(lastMaintainedChromeVersion);
const nextMaintainedVersion = versions[lastMaintainedIndex - 1];