forked from dylib-Finally/executor-
-
Notifications
You must be signed in to change notification settings - Fork 1
145 lines (117 loc) · 4.58 KB
/
build.yml
File metadata and controls
145 lines (117 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Build Roblox Executor iOS Dynamic Library
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: macos-latest # Use macOS for iOS compatible builds
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
echo "Installing dependencies..."
# Install essential build tools
brew install cmake pkg-config
# Create required directories
mkdir -p external/dobby/include
mkdir -p external/dobby/lib
mkdir -p output/Resources/AIData
mkdir -p build
# Remove any CI_BUILD definitions from source files
echo "Removing CI_BUILD definitions from source files..."
find source -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.cpp" -o -name "*.mm" \) | xargs sed -i '' 's/#define CI_BUILD//g' 2>/dev/null || true
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install Dobby (Required)
id: install-dobby
run: |
echo "Building Dobby from source (required dependency)..."
git clone --depth=1 https://github.com/jmpews/Dobby.git
cd Dobby
mkdir -p build && cd build
# Configure and build Dobby
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DDOBBY_BUILD_SHARED_LIBRARY=OFF \
-DDOBBY_BUILD_STATIC_LIBRARY=ON
cmake --build . --config Release
# Copy Dobby files to expected location
mkdir -p $GITHUB_WORKSPACE/external/dobby/lib
mkdir -p $GITHUB_WORKSPACE/external/dobby/include
cp libdobby.a $GITHUB_WORKSPACE/external/dobby/lib/
cp -r ../include/* $GITHUB_WORKSPACE/external/dobby/include/
echo "Dobby successfully built and installed to external/dobby"
cd $GITHUB_WORKSPACE
- name: Build Dynamic Library
run: |
echo "Building the iOS dynamic library..."
# Configure CMake directly
cmake -S . -B build \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="15.0" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=iOS \
-DENABLE_AI_FEATURES=ON \
-DUSE_DOBBY=ON
# Show CMake configuration for debugging
echo "CMake configuration from cache:"
cat build/CMakeCache.txt | grep -E "DOBBY|LUA|FLAGS|MODULE_PATH"
# Build the dynamic library
echo "Building the dynamic library now..."
cmake --build build --config Release -j4
# Check the build result
if [ -f "build/lib/libmylibrary.dylib" ]; then
echo "✅ Successfully built libmylibrary.dylib"
ls -la build/lib/libmylibrary.dylib
# Copy to output directory
mkdir -p output
cp build/lib/libmylibrary.dylib output/
# Copy any resources
if [ -d "Resources" ]; then
mkdir -p output/Resources
cp -r Resources/* output/Resources/ 2>/dev/null || true
fi
# Create config if it doesn't exist
mkdir -p output/Resources/AIData
if [ ! -f "output/Resources/AIData/config.json" ]; then
echo '{"version":"1.0.0","led_effects":true,"ai_features":true,"memory_optimization":true}' > output/Resources/AIData/config.json
fi
echo "== Built files =="
ls -la output/
else
echo "❌ Failed to build libmylibrary.dylib"
echo "== Build directory contents =="
find build -name "*.dylib" -o -name "*.a"
exit 1
fi
- name: Verify Library
run: |
echo "Verifying built dylib..."
if [ -f "output/libmylibrary.dylib" ]; then
echo "✅ libmylibrary.dylib exists"
# Check for exported symbols
echo "Exported symbols:"
nm -g output/libmylibrary.dylib | grep -E "luaopen_|ExecuteScript" || echo "No key symbols found!"
# Check library type
file output/libmylibrary.dylib
# Check library dependencies
otool -L output/libmylibrary.dylib || true
else
echo "❌ libmylibrary.dylib not found in output directory"
exit 1
fi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ios-dylib
path: |
output/libmylibrary.dylib
output/Resources/**