From e816b841f01f934294b319be16a9130d89be7c85 Mon Sep 17 00:00:00 2001 From: "Matthew \"strager\" Glazar" Date: Sat, 17 Aug 2024 21:21:39 -0400 Subject: [PATCH] fix(ci): install Node.js 20 needed by newer GitHub Actions runner The actions/download-artifact action is failing with the following message: /__e/node20/bin/node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /__e/node20/bin/node) The problem is that GitHub Actions is dropping Node.js 16 support [1], and their Node.js 20 binary is too new for our Ubuntu 18.04 Docker images. Install our own copy of Node.js 20 which is compatible with Ubuntu 18.04. [1] https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ --- .github/workflows/build-static.yml | 12 +++++++++++- .github/workflows/debian-package.yml | 15 +++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-static.yml b/.github/workflows/build-static.yml index b98668e38f..7676b3dc69 100644 --- a/.github/workflows/build-static.yml +++ b/.github/workflows/build-static.yml @@ -152,7 +152,7 @@ jobs: - {runs_on: ubuntu-latest, docker_container: "debian:buster", name: "Debian 10 Buster", archive_name: "linux", exe_file: "bin/quick-lint-js"} - {runs_on: ubuntu-latest, docker_container: "fedora:35", name: "Fedora 35", archive_name: "linux", exe_file: "bin/quick-lint-js"} - {runs_on: ubuntu-latest, docker_container: "fedora:36", name: "Fedora 36", archive_name: "linux", exe_file: "bin/quick-lint-js"} - - {runs_on: ubuntu-latest, docker_container: "ubuntu:18.04", name: "Ubuntu 18.04 LTS Bionic", archive_name: "linux", exe_file: "bin/quick-lint-js"} + - {runs_on: ubuntu-latest, docker_container: "ubuntu:18.04", name: "Ubuntu 18.04 LTS Bionic", archive_name: "linux", exe_file: "bin/quick-lint-js", install_node_20_ubuntu: true} - {runs_on: ubuntu-latest, docker_container: "ubuntu:20.04", name: "Ubuntu 20.04 LTS Focal", archive_name: "linux", exe_file: "bin/quick-lint-js"} runs-on: ${{ matrix.os.runs_on }} container: ${{ matrix.os.docker_container }} @@ -171,6 +171,16 @@ jobs: uname -a || : shell: bash + # Node.js 20 is required by actions/download-artifact. + # TODO(strager): Bake this step into the Docker image. + - name: install Node.js 20 on Ubuntu + if: ${{ matrix.os.install_node_20_ubuntu }} + run: | + curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh + bash nodesource_setup.sh + apt-get install nodejs + shell: bash + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: quick-lint-js-${{ matrix.os.archive_name }}-${{ github.sha }} diff --git a/.github/workflows/debian-package.yml b/.github/workflows/debian-package.yml index ab29bd080a..d660af2230 100644 --- a/.github/workflows/debian-package.yml +++ b/.github/workflows/debian-package.yml @@ -68,8 +68,8 @@ jobs: - {arch: amd64, runs_on: ubuntu-latest, docker_container: "debian:buster", name: "Debian 10 Buster"} - {arch: amd64, runs_on: ubuntu-latest, docker_container: "pureos/pureos:amber-latest", name: "PureOS Amber"} - {arch: amd64, runs_on: ubuntu-latest, docker_container: "ubuntu:16.04", name: "Ubuntu 16.04 LTS Xenial"} - - {arch: amd64, runs_on: ubuntu-latest, docker_container: "ubuntu:18.04", name: "Ubuntu 18.04 LTS Bionic"} - - {arch: amd64, runs_on: ubuntu-latest, docker_container: "ubuntu:20.04", name: "Ubuntu 20.04 LTS Focal"} + - {arch: amd64, runs_on: ubuntu-latest, docker_container: "ubuntu:18.04", name: "Ubuntu 18.04 LTS Bionic", install_node_20_ubuntu: true} + - {arch: amd64, runs_on: ubuntu-latest, docker_container: "ubuntu:20.04", name: "Ubuntu 20.04 LTS Focal", install_node_20_ubuntu: true} - {arch: arm64, runs_on: stracle-linux-aarch64, docker_container: "debian:bullseye", name: "Debian 11 Bullseye"} - {arch: arm64, runs_on: stracle-linux-aarch64, docker_container: "debian:buster", name: "Debian 10 Buster"} - {arch: arm64, runs_on: stracle-linux-aarch64, docker_container: "ubuntu:20.04", name: "Ubuntu 20.04 LTS Focal"} @@ -89,8 +89,19 @@ jobs: uname -a || : - name: update apt + if: ${{ not matrix.os.install_node_20_ubuntu }} run: apt-get update + # Node.js 20 is required by actions/download-artifact. + # TODO(strager): Bake this step into the Docker image. + - name: install Node.js 20 on Ubuntu + if: ${{ matrix.os.install_node_20_ubuntu }} + run: | + curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh + bash nodesource_setup.sh + apt-get install nodejs + shell: bash + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: quick-lint-js-deb-${{ matrix.os.arch }}-${{ github.sha }}