diff --git a/.dockerignore b/.dockerignore index c3fba8c..a789650 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ /.git +/Dockerfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 294e7d2..52f8989 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: strategy: matrix: - node-version: [12.x, 13.x] + node-version: [12.x, 13.x, 20.x] steps: - uses: actions/checkout@v2 @@ -47,8 +47,8 @@ jobs: - run: npm run doc - run: npm run test - run: npm run report-coverage - - run: npm run format && git diff --exit-code - if: ${{ matrix.node-version == '13.x' }} + - run: npm run format && git checkout package-lock.json && git diff --exit-code + if: ${{ matrix.node-version == '20.x' }} docker: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index b52ec66..abe570d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,44 @@ -FROM ubuntu:22.04 +FROM alpine:3.19.0 -RUN apt-get update && \ - DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ - ca-certificates \ - build-essential \ - cmake \ - git \ - libopus-dev \ - libsodium-dev \ - libvpx-dev \ - ninja-build \ - nodejs \ - npm \ - pkg-config \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* +RUN ["apk", "add", "--no-cache", \ + "cmake", \ + "diffutils", \ + "g++", \ + "gcc", \ + "git", \ + "libsodium-dev", \ + "libvpx-dev", \ + "linux-headers", \ + "make", \ + "musl-dev", \ + "npm", \ + "opus-dev", \ + "pkgconfig", \ + "python3", \ + "samurai"] WORKDIR /work/c-toxcore -RUN git clone --depth=1 --recurse-submodules --shallow-submodules --branch=master https://github.com/TokTok/c-toxcore.git /work/c-toxcore -RUN cmake -B_build -H. -GNinja -RUN cmake --build _build --target install +RUN ["git", "clone", "--depth=1", \ + "--recurse-submodules", "--shallow-submodules", \ + "--branch=master", \ + "https://github.com/TokTok/c-toxcore.git", "/work/c-toxcore"] +RUN ["cmake", "-B_build", "-H.", "-GNinja", "-DBOOTSTRAP_DAEMON=OFF"] +RUN ["cmake", "--build", "_build", "--target", "install"] WORKDIR /work/js-toxcore-c COPY . /work/js-toxcore-c/ ENV LD_LIBRARY_PATH=/usr/local/lib -RUN ls -l /usr/local/lib/libtoxcore.so -RUN npm install -RUN npm run doc -RUN npm run test -RUN npm run coverage -RUN npm run format -#COPY . /work/js-toxcore-c.orig/ -#RUN diff -ru /work/js-toxcore-c /work/js-toxcore-c.orig +RUN ["ls", "-lh", "/usr/local/lib/libtoxcore.so.2"] +RUN ["npm", "install"] +RUN ["npm", "run", "doc"] +RUN ["npm", "run", "test"] +RUN ["npm", "run", "coverage"] +RUN ["npm", "run", "format"] +COPY . /work/js-toxcore-c.orig/ +RUN rm -rf \ + /work/js-toxcore-c*/.nyc_output \ + /work/js-toxcore-c*/doc \ + /work/js-toxcore-c*/node_modules \ + /work/js-toxcore-c*/coverage.lcov \ + /work/js-toxcore-c*/package-lock.json +RUN diff -ru /work/js-toxcore-c /work/js-toxcore-c.orig diff --git a/package-lock.json b/package-lock.json index b259b62..07b4e49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "js-toxcore-c", - "version": "0.2.0", + "version": "0.2.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d2ac524..81fd40b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-toxcore-c", - "version": "0.2.0", + "version": "0.2.18", "description": "Node bindings for libtoxcore", "keywords": [ "im",