Skip to content

Commit d3ed0a7

Browse files
committed
Update LUA build module workflow
1 parent 7b3c7b8 commit d3ed0a7

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

.github/workflows/build-lua.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ name: Build and release Lua NGINX module
33
on:
44
workflow_dispatch:
55
push:
6-
tags:
7-
- "lua-*"
6+
tags: ["lua-*"]
7+
8+
permissions:
9+
contents: write
810

911
jobs:
1012
build-lua:
1113
runs-on: ubuntu-latest
12-
1314
steps:
1415
- name: Checkout source
1516
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1619

1720
- name: Set up QEMU
1821
uses: docker/setup-qemu-action@v3
@@ -32,14 +35,23 @@ jobs:
3235
.
3336
3437
- name: List artifacts
35-
run: ls -lah artifacts && ls -lah artifacts/artifacts
38+
run: |
39+
ls -lah artifacts
40+
file artifacts/* || true
3641
3742
- name: Create checksums
3843
run: |
39-
cd artifacts/artifacts
40-
sha256sum * > SHA256SUMS
44+
cd artifacts
45+
test -f ndk_http_module.so
46+
test -f ngx_http_lua_module.so
47+
if [ -f libluajit-5.1.so.2 ]; then
48+
sha256sum ndk_http_module.so ngx_http_lua_module.so libluajit-5.1.so.2 > SHA256SUMS
49+
else
50+
sha256sum ndk_http_module.so ngx_http_lua_module.so > SHA256SUMS
51+
fi
52+
cat SHA256SUMS
4153
42-
- name: Upload Lua modules to GitHub Release
54+
- name: Upload to GitHub Release
4355
uses: softprops/action-gh-release@v2
4456
if: startsWith(github.ref, 'refs/tags/')
4557
with:
@@ -48,5 +60,13 @@ jobs:
4860
artifacts/ngx_http_lua_module.so
4961
artifacts/libluajit-5.1.so.2
5062
artifacts/SHA256SUMS
63+
fail_on_unmatched_files: true
64+
generate_release_notes: true
5165
env:
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Upload workflow artifacts (fallback)
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: lua-nginx-mods-${{ github.ref_name }}
72+
path: artifacts/*

build/Dockerfile.luam

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ RUN ./configure --with-compat \
3434
RUN make modules -j"$(nproc)"
3535

3636
FROM scratch AS out
37-
COPY --from=build /usr/src/nginx-1.27.4/objs/ndk_http_module.so /artifacts/ndk_http_module.so
38-
COPY --from=build /usr/src/nginx-1.27.4/objs/ngx_http_lua_module.so /artifacts/ngx_http_lua_module.so
39-
COPY --from=build /usr/local/lib/libluajit-5.1.so.2 /artifacts/libluajit-5.1.so.2
37+
COPY --from=build /usr/src/nginx-1.27.4/objs/ndk_http_module.so /ndk_http_module.so
38+
COPY --from=build /usr/src/nginx-1.27.4/objs/ngx_http_lua_module.so /ngx_http_lua_module.so
39+
COPY --from=build /usr/local/lib/libluajit-5.1.so.2 /libluajit-5.1.so.2

0 commit comments

Comments
 (0)