From 44efbf745a49bf116c9f9f31b0abc5df7e7b4200 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Wed, 15 Apr 2026 19:31:10 +0800 Subject: [PATCH 1/4] feat: add luarocks publish workflow and 0.1.5 rockspec Add GitHub Actions workflow for publishing to LuaRocks (supports manual trigger and tag push), and create the 0.1.5 rockspec. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ lua-reqwest-0.1.5-1.rockspec | 28 ++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 lua-reqwest-0.1.5-1.rockspec diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7188660 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish to LuaRocks + +on: + workflow_dispatch: + push: + tags: + - "*" + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install LuaRocks + uses: hishamhm/gh-actions-lua@master + with: + luaVersion: "5.4" + + - uses: hishamhm/gh-actions-luarocks@master + + - name: Upload to LuaRocks + env: + LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} + run: | + luarocks upload lua-reqwest-0.1.5-1.rockspec --api-key="$LUAROCKS_API_KEY" diff --git a/lua-reqwest-0.1.5-1.rockspec b/lua-reqwest-0.1.5-1.rockspec new file mode 100644 index 0000000..805487e --- /dev/null +++ b/lua-reqwest-0.1.5-1.rockspec @@ -0,0 +1,28 @@ +package = "lua-reqwest" +version = "0.1.5-1" + +source = { + url = "git+https://github.com/oowl/lua-reqwest", + tag = "0.1.5", +} + +description = { + summary = "A Lua HTTP client based on rust reqwest", + detailed = [[ + A Lua HTTP client based on rust reqwest + ]], + homepage = "https://github.com/oowl/lua-reqwest", + license = "MIT" +} + +dependencies = { + "lua >= 5.1", + "luarocks-build-rust-mlua", +} + +build = { + type = "rust-mlua", + modules = { + "reqwest" + }, +} From 454bb48b892f66f2385bd5a409574846dfb58469 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Wed, 15 Apr 2026 19:32:29 +0800 Subject: [PATCH 2/4] fix: dynamically resolve rockspec filename from git tag Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/publish.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7188660..2c39bf7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,4 +23,10 @@ jobs: env: LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} run: | - luarocks upload lua-reqwest-0.1.5-1.rockspec --api-key="$LUAROCKS_API_KEY" + TAG="${GITHUB_REF#refs/tags/}" + ROCKSPEC="lua-reqwest-${TAG}-1.rockspec" + if [ ! -f "$ROCKSPEC" ]; then + echo "Error: $ROCKSPEC not found" + exit 1 + fi + luarocks upload "$ROCKSPEC" --api-key="$LUAROCKS_API_KEY" From c6b0b9fae0a54ce34d95e3002de991ddbba7b513 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Wed, 15 Apr 2026 19:32:59 +0800 Subject: [PATCH 3/4] fix: use lua 5.1 instead of 5.4 for luarocks publish Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2c39bf7..326fd00 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,7 @@ jobs: - name: Install LuaRocks uses: hishamhm/gh-actions-lua@master with: - luaVersion: "5.4" + luaVersion: "5.1" - uses: hishamhm/gh-actions-luarocks@master From 28aac16143831008f1df4939e4f8be3e8f7756b8 Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Wed, 15 Apr 2026 19:34:04 +0800 Subject: [PATCH 4/4] feat: add version input for manual workflow dispatch Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 326fd00..8c3895f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,10 @@ name: Publish to LuaRocks on: workflow_dispatch: + inputs: + version: + description: 'Version to publish (e.g. 0.1.5)' + required: true push: tags: - "*" @@ -23,7 +27,7 @@ jobs: env: LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }} run: | - TAG="${GITHUB_REF#refs/tags/}" + TAG="${{ github.event.inputs.version || github.ref_name }}" ROCKSPEC="lua-reqwest-${TAG}-1.rockspec" if [ ! -f "$ROCKSPEC" ]; then echo "Error: $ROCKSPEC not found"