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
64 changes: 63 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,68 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.PAT }}
release-type: simple
# release-type: simple is configured in release-please-config.json

- name: Checkout repository
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v4
with:
ref: ${{ steps.release.outputs.tag_name }}

- name: Install System Dependencies
if: ${{ steps.release.outputs.release_created }}
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq build-essential cmake luarocks lua5.4 liblua5.4-dev

- name: Install Lux
if: ${{ steps.release.outputs.release_created }}
uses: lumen-oss/gh-actions-lux@v1
with:
version: 0.25.3

- name: Install just
if: ${{ steps.release.outputs.release_created }}
run: |
mkdir -p /tmp/just
curl -L https://github.com/casey/just/releases/download/1.48.1/just-1.48.1-x86_64-unknown-linux-musl.tar.gz -o /tmp/just/just.tar.gz
tar -xzf /tmp/just/just.tar.gz -C /tmp/just
sudo mv /tmp/just/just /usr/local/bin/
rm -rf /tmp/just

- name: Build Executable
if: ${{ steps.release.outputs.release_created }}
env:
LUA_VERSION: "5.4"
LUA_PREFIX: "/usr"
LUA_LIB: "/usr/lib/x86_64-linux-gnu/liblua5.4.a"
run: |
just build
sha256sum roda > roda.sha256

- name: Generate Rockspec
if: ${{ steps.release.outputs.release_created }}
run: |
lx generate-rockspec

- name: Validate Rockspec
if: ${{ steps.release.outputs.release_created }}
run: |
luarocks lint *.rockspec

- name: Upload Release Artifacts
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ steps.release.outputs.tag_name }} roda roda.sha256 *.rockspec

- name: Publish to LuaRocks
if: ${{ steps.release.outputs.release_created }}
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
run: |
luarocks upload *.rockspec --api-key=${LUAROCKS_API_KEY}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.12.1"
}
23 changes: 12 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ set positional-arguments := true

# Lua installation prefix (default: brew --prefix lua on macOS, /usr on other platforms)
lua_prefix := env('LUA_PREFIX', if os() == "macos" { `brew --prefix lua` } else { "/usr" })
# Lua version for development headers (default: 5.5)
lua_version := "5.5"
# Lua version for development headers (default: 5.5 on macOS, 5.4 on Linux)
lua_version := env('LUA_VERSION', if os() == "macos" { "5.5" } else { "5.4" })
# Include path for Lua development headers (override with LUA_INCLUDE env var)
lua_include := env('LUA_INCLUDE', lua_prefix / ("include/lua" + lua_version))
# Static Lua library (adjust path if using shared library)
lua_lib := lua_prefix / "lib/liblua.a"
# Static Lua library (default: unversioned name; override with LUA_LIB env var)
lua_lib_unversioned := lua_prefix / "lib/liblua.a"
lua_lib := env('LUA_LIB', lua_lib_unversioned)
macos_version := if os() == "macos" { `sw_vers -productVersion | cut -d. -f1-2` } else { "" }
build_dir := absolute_path(clean(env('BUILD_DIR', '.build')))
package_name := "roda"
Expand All @@ -68,12 +69,12 @@ check-env:
[doc("Format Lua files")]
[group('dev')]
fmt:
lx --lua-version 5.5 fmt
lx --lua-version {{lua_version}} fmt

[doc("Lint Lua files")]
[group('dev')]
lint:
lx --lua-version 5.5 check
lx --lua-version {{lua_version}} check

[doc("Lint for CI (Lua 5.4)")]
[group('ci')]
Expand All @@ -90,7 +91,7 @@ check: lint fmt
[group('test')]
test-unit:
@echo "Running unit tests..."
lx --lua-version 5.5 --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" test
lx --lua-version {{lua_version}} --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" test

[doc("Alias for test-unit")]
[group('test')]
Expand All @@ -110,7 +111,7 @@ ensure-deps:
@echo "Ensuring dependencies are installed..."
CFLAGS="-I{{ lua_include }} {{ if os() == 'macos' { '-mmacosx-version-min=' + macos_version } else { '' } }}" \
{{ if os() == 'macos' { 'MACOSX_DEPLOYMENT_TARGET=' + macos_version } else { '' } }} \
lx --lua-version 5.5 --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" build --only-deps --no-lock
lx --lua-version {{lua_version}} --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" build --only-deps --no-lock

[doc("Build the standalone executable")]
[group('build')]
Expand Down Expand Up @@ -209,7 +210,7 @@ test-perf: build
install:
CFLAGS="-I{{ lua_include }} {{ if os() == 'macos' { '-mmacosx-version-min=' + macos_version } else { '' } }}" \
{{ if os() == 'macos' { 'MACOSX_DEPLOYMENT_TARGET=' + macos_version } else { '' } }} \
lx --lua-version 5.5 --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" build --only-deps --no-lock
lx --lua-version {{lua_version}} --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" build --only-deps --no-lock

[doc("Run spinner directly without building (development mode)")]
[group('dev')]
Expand Down Expand Up @@ -237,7 +238,7 @@ release: all
[group('release')]
publish: release
@echo "Publishing to LuaRocks..."
lx --lua-version 5.5 publish
lx --lua-version {{lua_version}} publish

# --- Maintenance ---

Expand All @@ -252,4 +253,4 @@ clean:
[doc("Update lux dependencies")]
[group('maintenance')]
update:
lx --lua-version 5.5 update
lx --lua-version {{lua_version}} update
14 changes: 14 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"packages": {
".": {
"release-type": "simple",
"extra-files": [
{
"type": "toml",
"path": "lux.toml",
"jsonpath": "$.version"
}
]
}
}
}
Loading