From 8095f0f533ec83e7a73d9000db7f60d5034b9c6e Mon Sep 17 00:00:00 2001 From: Jarvis Date: Fri, 14 Aug 2026 13:45:30 +0800 Subject: [PATCH 1/4] feat: release v0.7.2 --- rockspec/api7-lua-rapidjson-0.7.2-0.rockspec | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 rockspec/api7-lua-rapidjson-0.7.2-0.rockspec diff --git a/rockspec/api7-lua-rapidjson-0.7.2-0.rockspec b/rockspec/api7-lua-rapidjson-0.7.2-0.rockspec new file mode 100644 index 0000000..435003b --- /dev/null +++ b/rockspec/api7-lua-rapidjson-0.7.2-0.rockspec @@ -0,0 +1,28 @@ +package = "api7-lua-rapidjson" +version = "0.7.2-0" +local v = version:gsub("%-%d", "") +source = { + url = "git://github.com/api7/lua-rapidjson", + tag = "v"..v +} +description = { + summary = "Json module based on the very fast RapidJSON.", + detailed = "A json module for Lua 5.1/5.2/5.3 and LuaJIT based on the very fast RapidJSON, built for the x86-64 baseline so the module runs on any CPU.", + homepage = "https://github.com/api7/lua-rapidjson", + license = "MIT" +} +dependencies = { + "lua >= 5.1" +} +build = { + type = "cmake", + variables = { + BUILD_SHARED_LIBS = "ON", + CMAKE_INSTALL_PREFIX = "$(PREFIX)", + LUA_INCLUDE_DIR = "$(LUA_INCDIR)", + LUA_RAPIDJSON_VERSION = v + }, + platforms = { windows = { variables = { + LUA_LIBRARIES = "$(LUA_LIBDIR)/$(LUALIB)" + }}} +} From f88ecbf6038235b4c32a8a30b43848803ac6f0bf Mon Sep 17 00:00:00 2001 From: Jarvis Date: Fri, 14 Aug 2026 13:49:30 +0800 Subject: [PATCH 2/4] feat: release v0.7.2 Publish api7-lua-rapidjson 0.7.2-0: upstream lua-rapidjson 0.7.2 without the -march=native default. The repository now carries two rockspecs, so name the one that gets published in the build step instead of letting luarocks pick. --- .github/workflows/main.yml | 4 +++- rockspec/api7-lua-rapidjson-0.7.2-0.rockspec | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e54a181..a102799 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,9 @@ jobs: luarocks install busted - name: Build - run: luarocks make + # the repository carries upstream's rockspec as well, so name the one + # that gets published rather than letting luarocks pick + run: luarocks make "$(ls rockspec/*.rockspec | sort -V | tail -n1)" - name: Check the built module is portable shell: bash diff --git a/rockspec/api7-lua-rapidjson-0.7.2-0.rockspec b/rockspec/api7-lua-rapidjson-0.7.2-0.rockspec index 435003b..26ab473 100644 --- a/rockspec/api7-lua-rapidjson-0.7.2-0.rockspec +++ b/rockspec/api7-lua-rapidjson-0.7.2-0.rockspec @@ -1,13 +1,13 @@ package = "api7-lua-rapidjson" version = "0.7.2-0" -local v = version:gsub("%-%d", "") +local v = version:gsub("%-%d+$", "") source = { url = "git://github.com/api7/lua-rapidjson", tag = "v"..v } description = { summary = "Json module based on the very fast RapidJSON.", - detailed = "A json module for Lua 5.1/5.2/5.3 and LuaJIT based on the very fast RapidJSON, built for the x86-64 baseline so the module runs on any CPU.", + detailed = "A json module for Lua 5.1/5.2/5.3 and LuaJIT based on the very fast RapidJSON. api7 fork of xpol/lua-rapidjson, built without host-specific CPU tuning so a packaged module is not tied to the machine that built it.", homepage = "https://github.com/api7/lua-rapidjson", license = "MIT" } From cf8288806f40fbf5b3d2b6c9bb7875547c19da01 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Fri, 14 Aug 2026 14:53:25 +0800 Subject: [PATCH 3/4] chore: keep one rockspec in the repository Replace upstream's rapidjson rockspec with the api7-lua-rapidjson one instead of adding a second file next to it. With a single rockspec, `luarocks make` needs no argument, .luacheckrc's '*.rockspec' glob still covers it, and the release workflow names the file literally. Releases keep doing what upstream did: rename the rockspec to the new version rather than accumulate one file per release. --- .github/workflows/main.yml | 4 +-- .github/workflows/release.yml | 4 +-- README.md | 9 ++++-- ...pec => api7-lua-rapidjson-0.7.2-0.rockspec | 0 rapidjson-0.7.2-1.rockspec | 28 ------------------- 5 files changed, 9 insertions(+), 36 deletions(-) rename rockspec/api7-lua-rapidjson-0.7.2-0.rockspec => api7-lua-rapidjson-0.7.2-0.rockspec (100%) delete mode 100644 rapidjson-0.7.2-1.rockspec diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a102799..e54a181 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,9 +30,7 @@ jobs: luarocks install busted - name: Build - # the repository carries upstream's rockspec as well, so name the one - # that gets published rather than letting luarocks pick - run: luarocks make "$(ls rockspec/*.rockspec | sort -V | tail -n1)" + run: luarocks make - name: Check the built module is portable shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4c82a7..496da21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: branches: - "master" paths: - - 'rockspec/**' + - '*.rockspec' permissions: contents: write @@ -62,4 +62,4 @@ jobs: VERSION: ${{ steps.release_env.outputs.version_without_v }} run: | luarocks install dkjson - luarocks upload "rockspec/api7-lua-rapidjson-${VERSION}-0.rockspec" --api-key="${LUAROCKS_TOKEN}" + luarocks upload "api7-lua-rapidjson-${VERSION}-0.rockspec" --api-key="${LUAROCKS_TOKEN}" diff --git a/README.md b/README.md index e4446b7..c613e0a 100644 --- a/README.md +++ b/README.md @@ -88,10 +88,13 @@ See [API reference](API.md). ## Release Steps +This fork publishes the `api7-lua-rapidjson` rock. + 1. Pass all unit tests. -2. Update version in rapidjson-*.*.*-1.rockspec and update the name of the rockspec file. -3. Tag source code with that version (v*.*.*), and push. -4. `luarocks upload rapidjson-*.*.*-1.rockspec` +2. Rename `api7-lua-rapidjson-*.*.*-0.rockspec` to the new version and update `version` inside it. + Keep it the only rockspec in the repository, or `luarocks make` can no longer tell which to build. +3. Open a PR titled `feat: release v*.*.*` and merge it. The release workflow reads the version from + that commit message, tags the source and uploads the rock. ## Changelog diff --git a/rockspec/api7-lua-rapidjson-0.7.2-0.rockspec b/api7-lua-rapidjson-0.7.2-0.rockspec similarity index 100% rename from rockspec/api7-lua-rapidjson-0.7.2-0.rockspec rename to api7-lua-rapidjson-0.7.2-0.rockspec diff --git a/rapidjson-0.7.2-1.rockspec b/rapidjson-0.7.2-1.rockspec deleted file mode 100644 index c64bb59..0000000 --- a/rapidjson-0.7.2-1.rockspec +++ /dev/null @@ -1,28 +0,0 @@ -package = "rapidjson" -version = "0.7.2-1" -local v = version:gsub("%-%d", "") -source = { - url = "git://github.com/xpol/lua-rapidjson", - tag = "v"..v -} -description = { - summary = "Json module based on the very fast RapidJSON.", - detailed = "A json module for Lua 5.1/5.2/5.3 and LuaJIT based on the very fast RapidJSON.", - homepage = "https://github.com/xpol/lua-rapidjson", - license = "MIT" -} -dependencies = { - "lua >= 5.1" -} -build = { - type = "cmake", - variables = { - BUILD_SHARED_LIBS = "ON", - CMAKE_INSTALL_PREFIX = "$(PREFIX)", - LUA_INCLUDE_DIR = "$(LUA_INCDIR)", - LUA_RAPIDJSON_VERSION = v - }, - platforms = { windows = { variables = { - LUA_LIBRARIES = "$(LUA_LIBDIR)/$(LUALIB)" - }}} -} From 8af61ea4e5671a91d79df2647f9cb1c598af4017 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Fri, 14 Aug 2026 14:58:55 +0800 Subject: [PATCH 4/4] docs: install the rock this fork publishes The install commands still named upstream's rapidjson rock, which is not what this repository ships. The module name is unchanged. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c613e0a..62f0306 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,13 @@ bug report and feature request. ## Usage - luarocks install rapidjson + luarocks install api7-lua-rapidjson or if you like to use your own version of RapidJSON, use: - luarocks install rapidjson RAPIDJSON_INCLUDE_DIRS=path/to/rapidjson/include/dir + luarocks install api7-lua-rapidjson RAPIDJSON_INCLUDE_DIRS=path/to/rapidjson/include/dir + +The rock is named `api7-lua-rapidjson`; the module it installs is still `rapidjson`. ```Lua local rapidjson = require('rapidjson')