Update README.md #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Lua Dynamic Library | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macos-latest # Use a macOS environment to build the .dylib | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
echo "Installing dependencies..." | |
# Install Homebrew packages | |
brew install lua cmake luarocks openssl sqlite3 pkg-config # Install Lua, CMake, LuaRocks, OpenSSL, SQLite, and pkg-config | |
brew install libzip json-c # Install libzip and JSON-C libraries for ZIP and JSON handling | |
# brew install aes # Install AES encryption library, if available | |
# Install LuaRocks libraries | |
luarocks install luafilesystem # Install LuaFileSystem | |
# Add any other LuaRocks packages you need here | |
# luarocks install <other-package-name> | |
- name: Build Dynamic Library | |
id: build | |
run: | | |
echo "Building the dynamic library..." | |
mkdir -p build | |
cmake -S . -B build -DCMAKE_OSX_ARCHITECTURES="arm64" # Specify source and build directories | |
cmake --build build --config Release # Build without changing directories | |
# Set the built library path as an output variable | |
echo "OUTPUT_LIB_PATH=build/libmylibrary.dylib" >> $GITHUB_ENV | |
- name: Export the built library | |
run: | | |
echo "Exporting the built library..." | |
mkdir -p output | |
cp /Users/runner/work/Aedaniss7s-script-executor-roblox/Aedaniss7s-script-executor-roblox/lib/libmylibrary.dylib output/ # Use the environment variable for the output path | |
- name: Check Build Output | |
run: | | |
echo "Checking the build output..." | |
if [ -f output/libmylibrary.dylib ]; then | |
echo "libmylibrary.dylib exists." | |
else | |
echo "libmylibrary.dylib does not exist." | |
exit 1 # Exit with error if the library does not exist | |
fi | |
- name: Upload library | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mylibrary | |
path: output/libmylibrary.dylib |