diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81c22d94b..a8da36825 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,21 +20,29 @@ jobs: matrix: os: - macos-latest - - ubuntu-20.04 + - ubuntu-22.04 - windows-latest host: - x64 target: - x64 node: - - 18 + - 20 include: + - os: ubuntu-22.04 + node: 20 + host: x64 + target: arm64 - os: windows-latest - node: 18 - host: x86 + node: 20 + host: x64 target: x86 - - os: macos-m1 - node: 18 + - os: windows-latest + node: 20 + host: x64 + target: arm64 + - os: macos-latest + node: 20 host: arm64 target: arm64 name: ${{ matrix.os }} (host=${{ matrix.host }}, target=${{ matrix.target }}) @@ -46,18 +54,12 @@ jobs: architecture: ${{ matrix.host }} - name: Add yarn (self-hosted) - if: matrix.os == 'macos-m1' + if: matrix.os == 'macos-latest' run: npm install -g yarn - - name: Add setuptools for Python 3.12 (temp) - if: matrix.os != 'macos-m1' - run: pip install setuptools - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.3 + uses: microsoft/setup-msbuild@v2 if: contains(matrix.os, 'windows') - with: - msbuild-architecture: ${{ matrix.target }} - name: Install dependencies run: yarn install --ignore-scripts @@ -79,8 +81,23 @@ jobs: - name: Add Linux env vars if: contains(matrix.os, 'ubuntu') run: | - echo "CFLAGS=${CFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV - echo "CXXFLAGS=${CXXFLAGS:-} -include ../src/gcc-preinclude.h" >> $GITHUB_ENV + REPO_ROOT=$(pwd) + echo "CFLAGS=${CFLAGS:-} -include \"${REPO_ROOT}/src/gcc-preinclude.h\"" >> $GITHUB_ENV + echo "CXXFLAGS=${CXXFLAGS:-} -include \"${REPO_ROOT}/src/gcc-preinclude.h\"" >> $GITHUB_ENV + + - name: Setup cross compilation for Linux ARM64 + if: contains(matrix.os, 'ubuntu') && matrix.target == 'arm64' + run: | + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu + echo "AS=aarch64-linux-gnu-as" >> $GITHUB_ENV + echo "STRIP=aarch64-linux-gnu-strip" >> $GITHUB_ENV + echo "AR=aarch64-linux-gnu-ar" >> $GITHUB_ENV + echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + echo "CPP=aarch64-linux-gnu-cpp" >> $GITHUB_ENV + echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV + echo "LD=aarch64-linux-gnu-ld" >> $GITHUB_ENV + echo "FC=aarch64-linux-gnu-gfortran" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV - name: Build binaries run: yarn prebuild -a ${{ env.TARGET }} @@ -88,26 +105,31 @@ jobs: - name: Print binary info if: contains(matrix.os, 'ubuntu') run: | - ldd build/**/node_sqlite3.node + if [ "${{ matrix.target }}" = "arm64" ]; then + PREFIX=aarch64-linux-gnu- + fi + + ${PREFIX}readelf -d build/**/node_sqlite3.node | grep "Shared library" echo "---" - nm build/**/node_sqlite3.node | grep "GLIBC_" | c++filt || true + ${PREFIX}nm build/**/node_sqlite3.node | grep "GLIBC_" | ${PREFIX}c++filt || true echo "---" file build/**/node_sqlite3.node - name: Run tests + if: matrix.host == matrix.target run: yarn test - name: Upload binaries to commit artifacts uses: actions/upload-artifact@v4 - if: matrix.node == 18 + if: matrix.node == 20 with: - name: prebuilt-binaries + name: prebuilt-binaries-${{ matrix.os }}-host${{ matrix.host }}-target${{ matrix.target }}.zip path: prebuilds/* retention-days: 7 - name: Upload binaries to GitHub Release run: yarn upload --upload-all ${{ github.token }} - if: matrix.node == 18 && startsWith(github.ref, 'refs/tags/') + if: matrix.node == 20 && startsWith(github.ref, 'refs/tags/') build-qemu: runs-on: ubuntu-latest @@ -116,17 +138,16 @@ jobs: fail-fast: false matrix: node: - - 18 + - 20 target: - linux/arm64 variant: - - bullseye - - alpine3.15 + - alpine3.20 include: # musl x64 builds - target: linux/amd64 - variant: alpine3.15 - node: 18 + variant: alpine3.20 + node: 20 name: ${{ matrix.variant }} (node=${{ matrix.node }}, target=${{ matrix.target }}) steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 @@ -153,12 +174,12 @@ jobs: - name: Upload binaries to commit artifacts uses: actions/upload-artifact@v4 - if: matrix.node == 18 + if: matrix.node == 20 with: - name: prebuilt-binaries + name: prebuilt-binaries-${{ matrix.target }}-${{ matrix.variant }}.zip path: prebuilds/* retention-days: 7 - name: Upload binaries to GitHub Release run: yarn install --ignore-scripts && yarn upload --upload-all ${{ github.token }} - if: matrix.node == 18 && startsWith(github.ref, 'refs/tags/') + if: matrix.node == 20 && startsWith(github.ref, 'refs/tags/') diff --git a/package.json b/package.json index ab413ff4a..e45589a61 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sqlite3", "description": "Asynchronous, non-blocking SQLite3 bindings", - "version": "5.1.7", + "version": "5.1.8", "homepage": "https://github.com/TryGhost/node-sqlite3", "author": { "name": "Mapbox", @@ -41,21 +41,24 @@ ], "repository": { "type": "git", - "url": "https://github.com/TryGhost/node-sqlite3.git" + "url": "https://github.com/Amrsatrio/node-sqlite3.git" + }, + "engines": { + "node": ">=20" }, "dependencies": { "bindings": "^1.5.0", - "node-addon-api": "^7.0.0", + "node-addon-api": "^8.0.0", "prebuild-install": "^7.1.1", - "tar": "^6.1.11" + "tar": "^7.0.0" }, "devDependencies": { "eslint": "8.56.0", - "mocha": "10.2.0", - "prebuild": "12.1.0" + "mocha": "10.4.0", + "prebuild": "13.0.0" }, "peerDependencies": { - "node-gyp": "8.x" + "node-gyp": "^10.x" }, "peerDependenciesMeta": { "node-gyp": { @@ -63,7 +66,7 @@ } }, "optionalDependencies": { - "node-gyp": "8.x" + "node-gyp": "^10.x" }, "scripts": { "install": "prebuild-install -r napi || node-gyp rebuild", diff --git a/tools/BinaryBuilder.Dockerfile b/tools/BinaryBuilder.Dockerfile index 2e089b31d..b9b71408b 100644 --- a/tools/BinaryBuilder.Dockerfile +++ b/tools/BinaryBuilder.Dockerfile @@ -10,7 +10,8 @@ RUN if case $VARIANT in "alpine"*) true;; *) false;; esac; then apk add build-ba WORKDIR /usr/src/build COPY . . -RUN npm install --ignore-scripts + +RUN npm install --ignore-scripts --maxsockets=1 ENV CFLAGS="${CFLAGS:-} -include ../src/gcc-preinclude.h" ENV CXXFLAGS="${CXXFLAGS:-} -include ../src/gcc-preinclude.h" diff --git a/tools/semver-check.js b/tools/semver-check.js index 3b4a9a9c9..3dd6c9e07 100644 --- a/tools/semver-check.js +++ b/tools/semver-check.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const semver = require('semver'); -const supportedVersions = '10.12.0'; +const supportedVersions = process.versions.node; function checkEngines(modulePath) { const packageJsonPath = path.join(modulePath, 'package.json'); @@ -30,4 +30,3 @@ for (const dependency of allDependencies) { const modulePath = path.join(__dirname, '..', 'node_modules', dependency); checkEngines(modulePath); } -