Skip to content

Commit 8503c7a

Browse files
committed
Update LUA new-tag
1 parent e91a51c commit 8503c7a

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

.github/workflows/build-lua.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,41 @@ jobs:
1212

1313
steps:
1414
- name: Checkout source
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616

17-
- name: Build Lua module
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v3
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Build modules (linux/amd64) and export artifacts
24+
run: |
25+
docker buildx build \
26+
--platform=linux/amd64 \
27+
-f build/Dockerfile.luam \
28+
--target out \
29+
--output type=local,dest=./artifacts \
30+
--progress=plain \
31+
--no-cache \
32+
.
33+
34+
- name: List artifacts
35+
run: ls -lah artifacts
36+
37+
- name: Create checksums
1838
run: |
19-
docker build -f build/Dockerfile.luam -t lua-builder .
20-
docker create --name extract lua-builder
21-
docker cp extract:/usr/src/nginx-1.27.4/objs/ndk_http_module.so .
22-
docker cp extract:/usr/src/nginx-1.27.4/objs/ngx_http_lua_module.so .
23-
docker rm extract
39+
cd artifacts
40+
sha256sum * > SHA256SUMS
2441
2542
- name: Upload Lua modules to GitHub Release
26-
uses: softprops/action-gh-release@v1
43+
uses: softprops/action-gh-release@v2
44+
if: startsWith(github.ref, 'refs/tags/')
2745
with:
2846
files: |
29-
./ndk_http_module.so
30-
./ngx_http_lua_module.so
47+
artifacts/ndk_http_module.so
48+
artifacts/ngx_http_lua_module.so
49+
artifacts/libluajit-5.1.so.2
50+
artifacts/SHA256SUMS
3151
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build/Dockerfile.luam

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# --- minimal builder for ndk + lua modules (nginx 1.27.4, PCRE2) ---
21
FROM nginx:1.27.4 AS build
32

43
RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -9,38 +8,32 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
98

109
WORKDIR /usr/src
1110

12-
# LuaJIT (потрібен для збірки lua-модуля)
1311
RUN git clone --branch v2.1-agentzh --single-branch https://github.com/openresty/luajit2.git
1412
WORKDIR /usr/src/luajit2
1513
RUN make -j"$(nproc)" && make install
1614

1715
ENV LUAJIT_LIB=/usr/local/lib
1816
ENV LUAJIT_INC=/usr/local/include/luajit-2.1
1917

20-
# NDK + lua-nginx-module (версії сумісні з 1.27.x)
2118
ARG NDK_V=v0.3.3
2219
ARG LUA_NGX_V=v0.10.27
2320
WORKDIR /usr/src
2421
RUN git clone --branch "${NDK_V}" --single-branch https://github.com/simpl/ngx_devel_kit.git
2522
RUN git clone --branch "${LUA_NGX_V}" --single-branch https://github.com/openresty/lua-nginx-module.git
2623

27-
# NGINX sources рівно 1.27.4
2824
ARG NGINX_V=1.27.4
2925
RUN wget -O "nginx-${NGINX_V}.tar.gz" "http://nginx.org/download/nginx-${NGINX_V}.tar.gz" \
3026
&& tar zxf "nginx-${NGINX_V}.tar.gz"
3127

3228
WORKDIR /usr/src/nginx-${NGINX_V}
3329

34-
# Збірка динамічних модулів (без --with-pcre=*, авто PCRE2)
3530
RUN ./configure --with-compat \
3631
--add-dynamic-module=../ngx_devel_kit \
3732
--add-dynamic-module=../lua-nginx-module \
3833
--with-ld-opt="-Wl,-rpath,/usr/local/lib"
3934
RUN make modules -j"$(nproc)"
4035

41-
# --- stage із артефактами, щоб легко вивантажити їх локально ---
4236
FROM scratch AS out
4337
COPY --from=build /usr/src/nginx-1.27.4/objs/ndk_http_module.so /artifacts/ndk_http_module.so
4438
COPY --from=build /usr/src/nginx-1.27.4/objs/ngx_http_lua_module.so /artifacts/ngx_http_lua_module.so
45-
# якщо хочеш самодостатній рантайм без apt:
4639
COPY --from=build /usr/local/lib/libluajit-5.1.so.2 /artifacts/libluajit-5.1.so.2

0 commit comments

Comments
 (0)