Skip to content

Commit 68c2bfc

Browse files
authored
chore(ci): update build scripts and replace deno scripts with node.js … (#25)
* refactor: update build scripts and replace deno scripts with node.js for metadata generation, add CI that actually works - Changed the `metagen` script from Deno to Node.js in `package.json`. - Added new build scripts for `libffi` and `metagen` in `package.json`. - Updated CMakeLists to reflect the change from Deno to Node.js for metadata writing. - Removed obsolete Deno scripts related to `build_libffi` and `metagen`. - Deleted GitHub workflows for npm release and pull requests as part of the cleanup. * chore: update package dependencies and CI configuration - Removed the `prepare` script from `package.json`. - Added a name to the CI workflow in `.github/workflows/ci.yml`. - Updated `@nativescript/objc-node-api` dependency version to `^1.0.0-alpha.7` in both `packages/ios/package.json` and `packages/macos/package.json`. * refactor: enhance build_libffi.js for improved environment handling and path management - Refactored the script to use a helper function for path resolution, improving readability and maintainability. - Updated environment variable handling to ensure consistent usage across commands. - Added error handling for the configuration step to run autogen if necessary. - Adjusted file copy operations to utilize the new path helper for better clarity. * ci * ci * ci * ci * ci
1 parent 1d54e67 commit 68c2bfc

File tree

18 files changed

+526
-685
lines changed

18 files changed

+526
-685
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
steps:
13+
- uses: actions/checkout@v5
14+
with:
15+
submodules: 'recursive'
16+
17+
- name: Use Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '24.x'
21+
22+
- name: Install Dependencies
23+
run: npm install
24+
25+
- name: Install libffi build tools
26+
run: brew install autoconf automake libtool texinfo
27+
28+
- name: Build libffi
29+
run: npm run build-libffi
30+
31+
- name: Build metadata generator
32+
run: npm run build-metagen
33+
34+
- name: Build NativeScript
35+
run: npm run build

.github/workflows/npm_release.yml

Lines changed: 0 additions & 192 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 0 additions & 111 deletions
This file was deleted.

NativeScript/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ if(NOT METADATA_SIZE EQUAL 0)
335335
)
336336

337337
add_custom_command(TARGET ${NAME} POST_BUILD
338-
COMMAND deno run -A ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/write_metadata.ts $<TARGET_FILE:${NAME}> ${METADATA_FILE}
338+
COMMAND node ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/write_metadata.js $<TARGET_FILE:${NAME}> ${METADATA_FILE}
339339
)
340340

341341
add_custom_command(TARGET ${NAME} POST_BUILD

NativeScript/libffi/iphonesimulator-universal/include/ffi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file is generated by scripts/build_libffi.ts
1+
// This file is generated by scripts/build_libffi.js
22
// Merged from build_iphonesimulator-arm64/include/ffi.h and build_iphonesimulator-x86_64/include/ffi.h
33

44
#if defined(__aarch64__)
@@ -1070,4 +1070,4 @@ ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
10701070
#else
10711071
#error "Unsupported architecture"
10721072
#endif
1073-
1073+

NativeScript/libffi/iphonesimulator-universal/include/ffitarget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file is generated by scripts/build_libffi.ts
1+
// This file is generated by scripts/build_libffi.js
22
// Merged from build_iphonesimulator-arm64/include/ffitarget.h and build_iphonesimulator-x86_64/include/ffitarget.h
33

44
#if defined(__aarch64__)
@@ -269,4 +269,4 @@ typedef enum ffi_abi {
269269
#else
270270
#error "Unsupported architecture"
271271
#endif
272-
272+

NativeScript/libffi/macosx-universal/include/ffi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This file is generated by scripts/build_libffi.ts
1+
// This file is generated by scripts/build_libffi.js
22
// Merged from build_macosx-arm64/include/ffi.h and build_macosx-x86_64/include/ffi.h
33

44
#if defined(__aarch64__)
@@ -1070,4 +1070,4 @@ ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
10701070
#else
10711071
#error "Unsupported architecture"
10721072
#endif
1073-
1073+

0 commit comments

Comments
 (0)