From 58a90832482676497a349c3b654e03fab1f786f1 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 18 Jun 2024 15:23:36 +1000 Subject: [PATCH] add drone action --- .github/workflows/test.yml | 62 ++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 11 ++++++- package.json | 2 +- 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..24085d0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,62 @@ +name: libession-util-nodejs build test + +on: + push: + branches: + - main + - dev + - test-audric + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2022, macos-11, ubuntu-20.04] + env: + SIGNAL_ENV: production + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - run: git config --global core.autocrlf false + + - name: Checkout git repo + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + + - name: Install node + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.3.1 + if: runner.os == 'Windows' + + - name: Setup node for windows + if: runner.os == 'Windows' + shell: bash + run: | + yarn global add node-gyp@latest + + + - name: build libsession-util-nodejs for macos + if: runner.os == 'macOS' + shell: bash + run: | + export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" && yarn install --frozen-lockfile --network-timeout 600000 + + - name: build libsession-util-nodejs for others + shell: bash + if: runner.os != 'macOS' + run: yarn install --frozen-lockfile --network-timeout 600000 diff --git a/CMakeLists.txt b/CMakeLists.txt index c8b9fd3..fe42d28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,16 @@ cmake_minimum_required(VERSION 3.19) cmake_policy(SET CMP0091 NEW) cmake_policy(SET CMP0042 NEW) +cmake_policy(SET CMP0069 NEW) +set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) + +set(VERBOSE ON) + add_definitions(-DNAPI_VERSION=8) -set(CMAKE_CONFIGURATION_TYPES Release Debug) +set(CMAKE_CONFIGURATION_TYPES Release) + + + project(libsession_util_nodejs LANGUAGES CXX) @@ -18,6 +26,7 @@ file(GLOB SOURCE_FILES src/*.cpp) add_subdirectory(libsession-util) + if(MSVC) # Windows is horrible add_compile_definitions(NOMINMAX) diff --git a/package.json b/package.json index a34be46..5729b98 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "email": "team@oxen.io" }, "scripts": { - "install": "cmake-js compile --runtime=electron --runtime-version=25.8.4 -p16 --CDSUBMODULE_CHECK=OFF --CDLOCAL_MIRROR=https://oxen.rocks/deps" + "install": "cmake-js compile --runtime=electron --runtime-version=25.8.4 -p1 --CDSUBMODULE_CHECK=OFF --CDLOCAL_MIRROR=https://oxen.rocks/deps" }, "devDependencies": { "clang-format": "^1.8.0"