Skip to content

Commit

Permalink
Use cmake-fetch for dependencies (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager authored Nov 13, 2024
1 parent 546eebb commit ab57347
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 69 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Canary
on:
push:
tags:
- '*'
jobs:
canary:
runs-on: ubuntu-latest
steps:
- run: |
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.CANARY_DISPATCH_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/holepunchto/canary-tests/dispatches \
-d '{"event_type":"triggered-by-${{ github.event.repository.name }}-${{ github.ref_name }}"}'
2 changes: 0 additions & 2 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ jobs:
name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: lts/*
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/test-node.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
arch: x64
- os: macos-latest
platform: darwin
arch: arm64
- os: windows-latest
platform: win32
arch: x64
runs-on: ${{ matrix.os }}
name: ${{ matrix.platform }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm install -g bare-runtime bare-make
- run: npm install
- run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }}
- run: bare-make build
- run: bare-make install
- run: npm test
- run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} --debug --no-cache
- run: bare-make build
- run: bare-make install
- run: npm test
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
cmake_minimum_required(VERSION 3.25)

find_package(cmake-bare REQUIRED PATHS node_modules/cmake-bare)
find_package(cmake-fetch REQUIRED PATHS node_modules/cmake-fetch)
find_package(cmake-napi REQUIRED PATHS node_modules/cmake-napi)

project(udx_native C)

bare_target(target)

if(NOT TARGET udx)
add_subdirectory(vendor/libudx EXCLUDE_FROM_ALL)
endif()
fetch_package("github:holepunchto/libudx#906ab07")

add_bare_module(udx_native_bare)

target_sources(
${udx_native_bare}
PRIVATE
binding.c
PUBLIC
$<TARGET_OBJECTS:udx>
)

target_link_libraries(
${udx_native_bare}
PRIVATE
$<TARGET_OBJECTS:udx>
PUBLIC
udx
)
Expand All @@ -41,12 +40,12 @@ target_sources(
${udx_native_node}
PRIVATE
binding.c
PUBLIC
$<TARGET_OBJECTS:udx>
)

target_link_libraries(
${udx_native_node}
PRIVATE
$<TARGET_OBJECTS:udx>
PUBLIC
udx
)
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
"prebuilds",
"binding.c",
"binding.js",
"CMakeLists.txt",
"vendor/libudx/LICENSE",
"vendor/libudx/include",
"vendor/libudx/src",
"vendor/libudx/CMakeLists.txt"
"CMakeLists.txt"
],
"imports": {
"events": {
Expand Down Expand Up @@ -56,6 +52,7 @@
"devDependencies": {
"brittle": "^3.1.0",
"cmake-bare": "^1.1.10",
"cmake-fetch": "^1.0.1",
"cmake-napi": "^1.0.5",
"is-ci": "^3.0.1",
"standard": "^17.1.0",
Expand Down
1 change: 0 additions & 1 deletion vendor/libudx
Submodule libudx deleted from 2fc49d

0 comments on commit ab57347

Please sign in to comment.