Skip to content

Commit

Permalink
ci: fix updating Chrome (#10382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Jun 14, 2023
1 parent b332675 commit 0d219c7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/issue-analyzer.yml
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pre-release.yml
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
26 changes: 16 additions & 10 deletions tools/update_chrome_revision.mjs
Expand Up @@ -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 {
await replaceInFile(
'./versions.js',
VERSIONS_PER_RELEASE_COMMENT,
`${VERSIONS_PER_RELEASE_COMMENT}\n ['${version}', 'NEXT'],`
);
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];

Expand Down

0 comments on commit 0d219c7

Please sign in to comment.