Skip to content

Use sudo to ds renderer, fix chromium install/puppeteer #2488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
run:
if: ${{ contains(github.event.pull_request.labels.*.name, 'preview') || github.ref_name == 'main' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
concurrency:
group: netlify
cancel-in-progress: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/render-datasheets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
render-datasheets:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}

Expand Down
19 changes: 15 additions & 4 deletions scripts/datasheet-rendering/render-datasheets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,24 @@ if [ -n "$CI" ]; then
fc-list | grep "NotoSansSC"
fc-list | grep "NotoSansTC"

apt-get -qq update -y
sudo apt-get -qq update -y
# SEE: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
apt-get -qq install -y -o=Dpkg::Use-Pty=0 ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
sudo apt-get -qq install -y -o=Dpkg::Use-Pty=0 ca-certificates fonts-liberation libasound2 libappindicator3-1 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
sudo apt-get -qq install -y chromium || sudo apt-get -qq install -y chromium-browser

echo "Running on Node version: `node -v`"
npm install
npx datasheet-renderer config.json

echo "Setting up registry..."
npm config set registry https://registry.npmjs.org/
echo "Registry attuale: $(npm config get registry)"

echo "Installing dependencies..."
export PUPPETEER_SKIP_DOWNLOAD=true
npm install --verbose
export PUPPETEER_EXECUTABLE_PATH=$(which chromium || which chromium-browser)

echo "Running datasheet-renderer..."
time npx datasheet-renderer config.json
exit $?
fi

Expand Down