Skip to content

Commit

Permalink
Install node20 in containers
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed May 2, 2024
1 parent d964335 commit 25cc0ab
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ jobs:
# Need (newer) git, and the older Ubuntu container may require requesting the key manually using port 80
curl -sSL --retry ${NET_RETRY_COUNT:-5} 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xE1DD270288B4E6030699E45FA1715D88E1DF1F24' | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/git-core_ubuntu_ppa.gpg
for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
# Node 20 required for GH-actions
sudo mkdir -p /etc/apt/keyrings
curl -sSL --retry ${NET_RETRY_COUNT:-5} 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2F59B5F99B1BE0B4' | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] http://deb.nodesource.com/node_20.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
osver=$(lsb_release -sr | cut -f1 -d.)
pkgs="g++ git"
pkgs="g++ git nodejs"
# Ubuntu 22+ has only Python 3 in the repos
if [ -n "$osver" ] && [ "$osver" -ge "22" ]; then
pkgs+=" python-is-python3 libpython3-dev"
Expand All @@ -80,12 +84,6 @@ jobs:
echo "B2_USE_CCACHE=0" >> $GITHUB_ENV
fi
git config --global pack.threads 0
if [[ "${{matrix.container}}" == "ubuntu:16.04" ]] || [[ "${{matrix.container}}" == "ubuntu:18.04" ]]; then
# Ubuntu 16/18 can't run Node 20, so stick to older actions: https://github.com/actions/checkout/issues/1590
echo "GHA_USE_NODE_20=false" >> $GITHUB_ENV
else
echo "GHA_USE_NODE_20=true" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
if: env.GHA_USE_NODE_20 == 'false'
Expand Down

0 comments on commit 25cc0ab

Please sign in to comment.