From 52208d9ee8e845dbf8676ed03d10008744c0e3f1 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Fri, 7 Jul 2023 14:39:38 -0400 Subject: [PATCH] Build linux binaries in 18.04 docker container Bump node version to 18.16.0 (latest version that has arm64 windows builds) and use 18.16.1 nodejs unofficial-builds on 18.04 dockerfile. Official nodejs 18+ requires GLIBC 2.28 (bionic has 2.27). Add electron dependencies for checking with unit tests as well. --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f05af552867..000535621ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,12 +36,13 @@ jobs: build: name: ${{ matrix.friendlyName }} ${{ matrix.arch }} runs-on: ${{ matrix.os }} + container: ${{ matrix.image }} permissions: contents: write strategy: fail-fast: false matrix: - node: [18.14.0] + node: [18.16.0] os: [macos-11, windows-2019, ubuntu-20.04] arch: [x64, arm64] include: @@ -51,20 +52,50 @@ jobs: friendlyName: Windows - os: ubuntu-20.04 friendlyName: Ubuntu + image: ubuntu:18.04 timeout-minutes: 60 env: RELEASE_CHANNEL: ${{ inputs.environment }} steps: + - name: Install dependencies into dockerfile on Ubuntu + if: matrix.os == 'ubuntu-20.04' + run: | + # ubuntu dockerfile is very minimal (only 122 packages are installed) + # add dependencies expected by scripts + apt update + apt install -y software-properties-common lsb-release \ + sudo wget curl build-essential jq autoconf automake \ + pkg-config ca-certificates rpm \ + # add electron dependencies + apt install -y libasound2 libatk-bridge2.0-0 libatk1.0-0 \ + libatspi2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libdrm2 \ + libexpat1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 \ + libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 \ + libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 \ + libsecret-1-0 + # install new enough git to run actions/checkout + sudo add-apt-repository ppa:git-core/ppa -y + sudo apt update + sudo apt install -y git + # avoid "fatal: detected dubious ownership in repository at '/__w/shiftkey/desktop'" error + git config --global --add safe.directory '*' - uses: actions/checkout@v3 with: repository: ${{ inputs.repository || github.repository }} ref: ${{ inputs.ref }} submodules: recursive - name: Use Node.js ${{ matrix.node }} + if: matrix.os != 'ubuntu-20.04' uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: yarn + - name: Install unofficial-builds Node.js 18.16.1 on Ubuntu + if: matrix.os == 'ubuntu-20.04' + run: | + # this version supports older GLIBC (official builds required a minimum of GLIBC 2.28) + curl -sL 'https://unofficial-builds.nodejs.org/download/release/v18.16.1/node-v18.16.1-linux-x64-glibc-217.tar.xz' | xzcat | sudo tar -vx --strip-components=1 -C /usr/local/ + sudo npm install --global yarn # This step can be removed as soon as official Windows arm64 builds are published: # https://github.com/nodejs/build/issues/2450#issuecomment-705853342