From b7268083726fa1344a5e727be94d75cef24b0c73 Mon Sep 17 00:00:00 2001 From: Asif Ansari Date: Tue, 27 Oct 2026 00:02:33 +0530 Subject: [PATCH 1/4] ci: time-limit the Playwright install in the publish workflow A stalled browser download would hold the publish job until GitHub's 6-hour default; ci.yml already caps the same step at 10 minutes. Also renames the step, which installs all three engines, not only Chromium. --- .github/workflows/npm-publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index d62e557..845b013 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -35,7 +35,9 @@ jobs: - name: Unit tests run: npm test - - name: Install Chromium for browser tests + - name: Install Playwright browsers + # A stalled download otherwise holds the publish job until GitHub's 6-hour default. + timeout-minutes: 10 run: npx playwright install --with-deps chromium firefox webkit - name: Browser tests From 38f4a526a28714befad757f578a2840066b4ba73 Mon Sep 17 00:00:00 2001 From: Asif Ansari Date: Tue, 27 Oct 2026 00:19:57 +0530 Subject: [PATCH 2/4] ci: retry a stalled Playwright install instead of failing --- .github/workflows/ci.yml | 12 +++++++++--- .github/workflows/npm-publish.yml | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc7359d..6c8d739 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,9 +63,15 @@ jobs: - name: Install Playwright browsers if: steps.playwright-cache.outputs.cache-hit != 'true' - # A stalled download otherwise holds the job until its 40-minute timeout (seen on PR #15). - timeout-minutes: 10 - run: npx playwright install --with-deps chromium firefox webkit + # The Ubuntu mirror behind --with-deps sometimes stalls (PRs #15, #16, #17): give each + # attempt 6 minutes and retry on a fresh connection; the step timeout is a backstop. + timeout-minutes: 20 + run: | + for attempt in 1 2 3; do + timeout 6m npx playwright install --with-deps chromium firefox webkit && exit 0 + echo "Playwright install attempt $attempt stalled or failed, retrying" + done + exit 1 - name: Install Playwright system dependencies if: steps.playwright-cache.outputs.cache-hit == 'true' diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 845b013..9cb9cd7 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -36,9 +36,15 @@ jobs: run: npm test - name: Install Playwright browsers - # A stalled download otherwise holds the publish job until GitHub's 6-hour default. - timeout-minutes: 10 - run: npx playwright install --with-deps chromium firefox webkit + # The Ubuntu mirror behind --with-deps sometimes stalls (PRs #15, #16, #17): give each + # attempt 6 minutes and retry on a fresh connection; the step timeout is a backstop. + timeout-minutes: 20 + run: | + for attempt in 1 2 3; do + timeout 6m npx playwright install --with-deps chromium firefox webkit && exit 0 + echo "Playwright install attempt $attempt stalled or failed, retrying" + done + exit 1 - name: Browser tests run: npm run test:browser From fc2f7482bb3a70f60138a3c3a23a08446a8ec433 Mon Sep 17 00:00:00 2001 From: Asif Ansari Date: Tue, 27 Oct 2026 00:31:56 +0530 Subject: [PATCH 3/4] ci: stop the stray apt-get between Playwright install retries --- .github/workflows/ci.yml | 9 +++++++-- .github/workflows/npm-publish.yml | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c8d739..d5af8d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,13 +63,18 @@ jobs: - name: Install Playwright browsers if: steps.playwright-cache.outputs.cache-hit != 'true' - # The Ubuntu mirror behind --with-deps sometimes stalls (PRs #15, #16, #17): give each - # attempt 6 minutes and retry on a fresh connection; the step timeout is a backstop. + # The Ubuntu mirror behind --with-deps sometimes stalls (PRs #15, #16, #17). apt retries + # stalled downloads and waits for the dpkg lock; each attempt gets 6 minutes, and the + # root apt-get that timeout cannot reach is stopped before the next one. timeout-minutes: 20 run: | + printf 'Acquire::Retries "5";\nAcquire::http::Timeout "30";\nDPkg::Lock::Timeout "120";\n' \ + | sudo tee /etc/apt/apt.conf.d/80-ci-retries > /dev/null for attempt in 1 2 3; do timeout 6m npx playwright install --with-deps chromium firefox webkit && exit 0 echo "Playwright install attempt $attempt stalled or failed, retrying" + sudo pkill -9 -x apt-get || true + sudo dpkg --configure -a || true done exit 1 diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 9cb9cd7..fe7f4cc 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -36,13 +36,18 @@ jobs: run: npm test - name: Install Playwright browsers - # The Ubuntu mirror behind --with-deps sometimes stalls (PRs #15, #16, #17): give each - # attempt 6 minutes and retry on a fresh connection; the step timeout is a backstop. + # The Ubuntu mirror behind --with-deps sometimes stalls (PRs #15, #16, #17). apt retries + # stalled downloads and waits for the dpkg lock; each attempt gets 6 minutes, and the + # root apt-get that timeout cannot reach is stopped before the next one. timeout-minutes: 20 run: | + printf 'Acquire::Retries "5";\nAcquire::http::Timeout "30";\nDPkg::Lock::Timeout "120";\n' \ + | sudo tee /etc/apt/apt.conf.d/80-ci-retries > /dev/null for attempt in 1 2 3; do timeout 6m npx playwright install --with-deps chromium firefox webkit && exit 0 echo "Playwright install attempt $attempt stalled or failed, retrying" + sudo pkill -9 -x apt-get || true + sudo dpkg --configure -a || true done exit 1 From 0268d9f3ce7345e6dffe397222f0f9ac96b0b1a9 Mon Sep 17 00:00:00 2001 From: Asif Ansari Date: Tue, 27 Oct 2026 09:20:57 +0530 Subject: [PATCH 4/4] ci: publish to npm through trusted publishing instead of a token --- .github/workflows/npm-publish.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index fe7f4cc..677d2b8 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -11,6 +11,9 @@ jobs: permissions: contents: read + # Trusted publishing (OIDC): npm accepts this repo + this workflow file name, + # so renaming npm-publish.yml needs the same change on the npm package settings. + id-token: write steps: - name: Checkout @@ -23,6 +26,10 @@ jobs: registry-url: 'https://registry.npmjs.org' cache: 'npm' + - name: Update npm for trusted publishing + # Node 22 ships npm 10; trusted publishing needs npm 11.5.1 or later. + run: npm install -g npm@11 + - name: Install dependencies run: npm ci @@ -82,5 +89,3 @@ jobs: - name: Publish run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}