update for node 21 (#1794)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
This commit is contained in:
Andrew Calcutt
2023-10-23 11:06:58 -04:00
committed by GitHub
parent da45706601
commit ae2c90719e
5 changed files with 55 additions and 24 deletions

View File

@@ -53,7 +53,7 @@ jobs:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-20.04
- runs-on: ubuntu-22.04
arch: x86_64
- runs-on: [self-hosted, linux, ARM64]
arch: arm64
@@ -69,7 +69,7 @@ jobs:
needs: bump_version
continue-on-error: true
env:
BUILDTYPE: 'Release'
BUILDTYPE: "Release"
defaults:
run:
@@ -117,16 +117,13 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
ccache \
cmake \
ninja-build \
pkg-config \
xvfb \
libcurl4-openssl-dev \
libglfw3-dev \
libuv1-dev \
g++-10 \
libc++-9-dev \
libc++abi-9-dev \
g++-12 \
libjpeg-dev \
libpng-dev \
libwebp-dev
@@ -135,7 +132,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: npm ci
run: npm ci --ignore-scripts
@@ -144,6 +141,20 @@ jobs:
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
# Fixes an issue with the image causing builds to fail - https://github.com/actions/runner-images/issues/8598
- name: Remove Strawberry Perl from PATH (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$env:PATH = $env:PATH -replace "C:\\Strawberry\\c\\bin;", ""
"PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Setup cmake (Linux)
if: runner.os == 'Linux' && runner.arch != 'arm64'
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: "3.19.x"
- name: Set up ccache (MacOS/Linux)
if: runner.os == 'MacOS' || runner.os == 'Linux'
uses: hendrikmuhs/ccache-action@v1
@@ -158,13 +169,20 @@ jobs:
if: runner.os == 'Windows'
uses: hendrikmuhs/ccache-action@v1
with:
variant: 'sccache'
variant: "sccache"
key: ${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
restore-keys: |
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}
- name: Cache cmake-node-module deps
uses: actions/cache@v3
with:
# downloaded with platform/node/cmake/module.cmake
path: build/headers
key: ${{ runner.os }}-${{ runner.arch }}-cmake-node-module-deps
- name: Configure maplibre-native (MacOS)
if: runner.os == 'MacOS'
run: |
@@ -172,16 +190,19 @@ jobs:
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DMLN_WITH_NODE=ON
- name: Configure maplibre-native (Linux)
if: runner.os == 'Linux'
shell: bash -leo pipefail {0}
run: |
cmake . -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=gcc-10 \
-DCMAKE_CXX_COMPILER=g++-10
-DCMAKE_C_COMPILER=gcc-12 \
-DCMAKE_CXX_COMPILER=g++-12 \
-DMLN_WITH_NODE=ON
- name: "Create directory '${{ github.workspace }}/platform/windows/vendor/vcpkg/bincache' (Windows)"
if: runner.os == 'Windows'
@@ -207,7 +228,8 @@ jobs:
cmake . -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DMLN_WITH_NODE=ON
- name: Build maplibre-native (MacOS/Linux)
if: runner.os == 'MacOS' || runner.os == 'Linux'
@@ -238,7 +260,7 @@ jobs:
./platform/node/scripts/publish.sh --target_arch=arm64
publish_npm:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: publish_binaries
defaults:
@@ -257,7 +279,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: Publish to NPM (release)
if: github.ref == 'refs/heads/main' && (github.event.inputs.version == 'patch' || github.event.inputs.version == 'minor' || github.event.inputs.version == 'major')