diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1e8158..36f3b43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,3 +45,4 @@ jobs: generate_release_notes: true files: | build/noiseprotocol.lua + build/noiseprotocol-core.lua diff --git a/Makefile b/Makefile index f422802..5dbca7c 100644 --- a/Makefile +++ b/Makefile @@ -53,17 +53,20 @@ build: build/amalg.cache @if command -v amalg.lua >/dev/null 2>&1; then \ LUA_PATH="./src/?.lua;./src/?/init.lua;$(LUA_PATH)" amalg.lua -o build/noiseprotocol.lua -C ./build/amalg.cache || exit 1;\ echo "Built build/noiseprotocol.lua"; \ + LUA_PATH="./src/?.lua;./src/?/init.lua;$(LUA_PATH)" amalg.lua -o build/noiseprotocol-core.lua -C ./build/amalg.cache -i "vendor%." || exit 1;\ + echo "Built build/noiseprotocol-core.lua (no vendor dependencies)"; \ VERSION=$$(git describe --exact-match --tags 2>/dev/null || echo "dev"); \ if [ "$$VERSION" != "dev" ]; then \ echo "Injecting version $$VERSION..."; \ sed -i.bak 's/VERSION = "dev"/VERSION = "'$$VERSION'"/' build/noiseprotocol.lua && rm build/noiseprotocol.lua.bak; \ + sed -i.bak 's/VERSION = "dev"/VERSION = "'$$VERSION'"/' build/noiseprotocol-core.lua && rm build/noiseprotocol-core.lua.bak; \ fi; \ echo "Testing version function..."; \ LUA_VERSION=$$(lua -e 'local n = require("build.noiseprotocol"); print(n.version())' 2>/dev/null || echo "test failed"); \ if [ "$$LUA_VERSION" = "$$VERSION" ]; then \ - echo "✅ Version correctly set to: $$VERSION"; \ + echo "Version correctly set to: $$VERSION"; \ else \ - echo "❌ Version test failed. Expected: $$VERSION, Got: $$LUA_VERSION"; \ + echo "Version test failed. Expected: $$VERSION, Got: $$LUA_VERSION"; \ fi; \ else \ echo "Error: amalg not found."; \ diff --git a/README.md b/README.md index ea64524..2143057 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,18 @@ runs on Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT. ## Installation +### Option 1: Single-file Distribution (Recommended) + +Download a pre-built single-file module from the +[Releases](https://github.com/finitelabs/lua-noiseprotocol/releases) page: + +- **`noiseprotocol.lua`** - Complete bundle with all dependencies included (zero + external dependencies) +- **`noiseprotocol-core.lua`** - Core library only, requires `vendor.bitn` to be + installed separately + +### Option 2: From Source + Clone this repository: ```bash @@ -24,7 +36,8 @@ git clone https://github.com/finitelabs/lua-noiseprotocol.git cd lua-noiseprotocol ``` -Add the `src` directory to your Lua path, or copy the files to your project. +Add the `src` and `vendor` directories to your Lua path, or copy the files to +your project. ## Usage diff --git a/vendor/json.lua b/tests/vendor/json.lua similarity index 100% rename from vendor/json.lua rename to tests/vendor/json.lua