Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ jobs:
generate_release_notes: true
files: |
build/noiseprotocol.lua
build/noiseprotocol-core.lua
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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."; \
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,27 @@ 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
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

Expand Down
File renamed without changes.
Loading