You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@casbin.apache.org by hs...@apache.org on 2026/08/06 14:19:17 UTC
(casbin-lua-casbin) branch master updated: ci: replace leafo/gh-actions-luarocks with a local composite action
This is an automated email from the ASF dual-hosted git repository.
hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-lua-casbin.git
The following commit(s) were added to refs/heads/master by this push:
new 687cf12 ci: replace leafo/gh-actions-luarocks with a local composite action
687cf12 is described below
commit 687cf1296f2f39735378dfac83d4e91752db3c71
Author: Yang Luo <hs...@gmail.com>
AuthorDate: Thu Aug 6 22:19:09 2026 +0800
ci: replace leafo/gh-actions-luarocks with a local composite action
---
.github/actions/setup-luarocks/action.yml | 53 +++++++++++++++++++++++++++++++
.github/workflows/build.yml | 4 +--
.github/workflows/release.yml | 2 +-
3 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/.github/actions/setup-luarocks/action.yml b/.github/actions/setup-luarocks/action.yml
new file mode 100644
index 0000000..331391b
--- /dev/null
+++ b/.github/actions/setup-luarocks/action.yml
@@ -0,0 +1,53 @@
+name: "Set up LuaRocks"
+description: >
+ Build and install LuaRocks against the Lua tree produced by leafo/gh-actions-lua.
+ This replaces leafo/gh-actions-luarocks, which the Apache enterprise action
+ allowlist does not permit. Actions living in this repository are always allowed,
+ so the same steps are kept here instead.
+
+inputs:
+ luaRocksVersion:
+ description: "The version of LuaRocks to build, as published on https://luarocks.org/releases/"
+ required: false
+ default: "3.13.0"
+ withLuaPath:
+ description: "Existing Lua installation to build against (./configure --with-lua). Defaults to the .lua directory created by leafo/gh-actions-lua."
+ required: false
+ default: ""
+
+runs:
+ using: composite
+ steps:
+ - name: Build and install LuaRocks
+ shell: bash
+ env:
+ LUAROCKS_VERSION: ${{ inputs.luaRocksVersion }}
+ WITH_LUA_PATH: ${{ inputs.withLuaPath }}
+ run: |
+ set -euo pipefail
+
+ lua_dir="${WITH_LUA_PATH:-}"
+ if [ -z "$lua_dir" ]; then
+ # Default install path used by leafo/gh-actions-lua.
+ lua_dir="${GITHUB_WORKSPACE}/.lua"
+ fi
+
+ build_dir="${RUNNER_TEMP}/.build-luarocks"
+ install_dir="${GITHUB_WORKSPACE}/.luarocks"
+
+ mkdir -p "$build_dir"
+ curl -fsSL "https://luarocks.org/releases/luarocks-${LUAROCKS_VERSION}.tar.gz" \
+ | tar -xz -C "$build_dir"
+
+ cd "${build_dir}/luarocks-${LUAROCKS_VERSION}"
+ ./configure --with-lua="$lua_dir" --prefix="$install_dir"
+ make
+ make install
+
+ # Expose luarocks and the rocks tree to the following steps.
+ luarocks="${install_dir}/bin/luarocks"
+ "$luarocks" path --lr-bin >> "$GITHUB_PATH"
+ {
+ echo "LUA_PATH=;;$("$luarocks" path --lr-path)"
+ echo "LUA_CPATH=;;$("$luarocks" path --lr-cpath)"
+ } >> "$GITHUB_ENV"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e911e41..146ab03 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -30,7 +30,7 @@ jobs:
luaVersion: ${{ matrix.lua-version }}
- name: Set up luarocks
- uses: leafo/gh-actions-luarocks@v6
+ uses: ./.github/actions/setup-luarocks
- name: Install PCRE
run: |
@@ -103,7 +103,7 @@ jobs:
luaVersion: "luajit-openresty"
- name: Set up luarocks
- uses: leafo/gh-actions-luarocks@v4.0.0
+ uses: ./.github/actions/setup-luarocks
- name: Install PCRE
run: |
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 32c07a5..89b6fc6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -93,7 +93,7 @@ jobs:
luaVersion: 5.1
- name: Set up luarocks
- uses: leafo/gh-actions-luarocks@v4.0.0
+ uses: ./.github/actions/setup-luarocks
- name: Set up CJSON
run: luarocks install lua-cjson
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For additional commands, e-mail: commits-help@casbin.apache.org