forked from Free-dylib-4-test/executor
-
Notifications
You must be signed in to change notification settings - Fork 3
161 lines (131 loc) · 5.57 KB
/
build.yml
File metadata and controls
161 lines (131 loc) · 5.57 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
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 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
# Verify and fix VM folder structure if needed
echo "Verifying VM folder structure..."
if [ -d "VM" ] && [ -d "VM/include" ] && [ -d "VM/src" ]; then
echo "✅ VM folder structure verified"
ls -la VM/include/
ls -la VM/src/ | head -n 5
# Make sure VM files are readable
echo "Ensuring VM files have correct permissions..."
chmod -R 755 VM
# Count source files to verify
VM_SRC_COUNT=$(find VM/src -name "*.cpp" | wc -l)
VM_INCLUDE_COUNT=$(find VM/include -name "*.h" | wc -l)
echo "Found $VM_SRC_COUNT .cpp files and $VM_INCLUDE_COUNT .h files in VM directory"
else
echo "⚠️ VM folder structure has issues, creating required directories..."
mkdir -p VM/include VM/src
fi
- 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 with Makefile
run: |
echo "Building the iOS dynamic library using Makefile instead of CMake..."
# Make sure VM files are accessible
echo "Preparing VM files for inclusion..."
find VM -name "*.cpp" -o -name "*.h" | xargs ls -la || true
# Test VM file access
echo "Testing VM file access..."
VM_SOURCE_COUNT=$(find VM/src -name "*.cpp" | wc -l)
VM_HEADER_COUNT=$(find VM/include -name "*.h" | wc -l)
echo "Found $VM_SOURCE_COUNT C++ files in VM/src and $VM_HEADER_COUNT headers in VM/include"
# Set iOS-specific build settings for the Makefile
echo "Setting up iOS build environment..."
export SDK=$(xcrun --sdk iphoneos --show-sdk-path)
export ARCHS="arm64"
export MIN_IOS_VERSION="15.0"
# Build using Makefile with verbose output
echo "Building with Makefile instead of CMake..."
make info # Show build information
make clean # Clean any previous build artifacts
make -j4 # Build using Makefile with parallel jobs
make install # Install to output directory
# Check the build result
if [ -f "output/libmylibrary.dylib" ]; then
echo "✅ Successfully built libmylibrary.dylib with Makefile"
ls -la output/libmylibrary.dylib
# 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/**