diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cb59f8..5bc46a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: - "docs/**" env: - ROCKSPEC_VERSION: 0.0.1 + ROCKSPEC_VERSION: 0.0.2 DEV_ROCKSPEC: lua-uuid-dev-1.rockspec jobs: @@ -46,7 +46,7 @@ jobs: - name: Set environment variable to hold the rockspec name run: | - if ("${{ github.repository }}" -eq "luau-project/lua-uuid" -and "${{ github.ref_name }}" -eq "main" -and "${{ github.ref }}" -eq "refs/tags/v${{ env.ROCKSPEC_VERSION }}") + if ("${{ github.repository }}" -eq "luau-project/lua-uuid" -and "${{ github.ref_name }}" -eq "v${{ env.ROCKSPEC_VERSION }}" -and "${{ github.ref }}" -eq "refs/tags/v${{ env.ROCKSPEC_VERSION }}") { Add-Content "${{ github.env }}" "ROCKSPEC=lua-uuid-${{ env.ROCKSPEC_VERSION }}-0.rockspec"; } @@ -143,7 +143,7 @@ jobs: - name: Set environment variable to hold the rockspec name run: | - if [[ "${{ github.repository }}" == "luau-project/lua-uuid" ]] && [[ "${{ github.ref_name }}" == "main" ]] && [[ "${{ github.ref }}" == "refs/tags/v${{ env.ROCKSPEC_VERSION }}" ]]; + if [[ "${{ github.repository }}" == "luau-project/lua-uuid" ]] && [[ "${{ github.ref_name }}" == "v${{ env.ROCKSPEC_VERSION }}" ]] && [[ "${{ github.ref }}" == "refs/tags/v${{ env.ROCKSPEC_VERSION }}" ]]; then echo "ROCKSPEC=lua-uuid-${{ env.ROCKSPEC_VERSION }}-0.rockspec" >> "${{ github.env }}"; else @@ -184,7 +184,7 @@ jobs: upload-rockspec: name: Upload rockspec runs-on: ubuntu-latest - if: ${{ github.repository == 'luau-project/lua-uuid' && github.ref_name == 'main' && startsWith(github.ref, 'refs/tags/') }} + if: ${{ github.repository == 'luau-project/lua-uuid' && startsWith(github.ref, 'refs/tags/') }} needs: - build - msys2-build @@ -197,7 +197,7 @@ jobs: - name: Set environment variable to hold the rockspec name run: | - if ("${{ github.repository }}" -eq "luau-project/lua-uuid" -and "${{ github.ref_name }}" -eq "main" -and "${{ github.ref }}" -eq "refs/tags/v${{ env.ROCKSPEC_VERSION }}") + if ("${{ github.repository }}" -eq "luau-project/lua-uuid" -and "${{ github.ref_name }}" -eq "v${{ env.ROCKSPEC_VERSION }}" -and "${{ github.ref }}" -eq "refs/tags/v${{ env.ROCKSPEC_VERSION }}") { Add-Content "${{ github.env }}" "ROCKSPEC=lua-uuid-${{ env.ROCKSPEC_VERSION }}-0.rockspec"; } @@ -212,7 +212,7 @@ jobs: path: lua-uuid - name: Install libuuid-dev - run: sudo apt install -y uuid-dev + run: sudo apt install -y uuid-dev libssl-dev - name: Setup Lua uses: luarocks/gh-actions-lua@v10 @@ -221,8 +221,10 @@ jobs: uses: luarocks/gh-actions-luarocks@v5 - name: Install dependencies - run: luarocks install dkjson - working-directory: lua-uuid + run: | + luarocks install dkjson + luarocks install luasocket + luarocks install luasec - name: Upload rockspec to LuaRocks working-directory: lua-uuid diff --git a/rockspecs/lua-uuid-0.0.1-0.rockspec b/rockspecs/lua-uuid-0.0.1-0.rockspec index 078755a..8a2a083 100644 --- a/rockspecs/lua-uuid-0.0.1-0.rockspec +++ b/rockspecs/lua-uuid-0.0.1-0.rockspec @@ -8,7 +8,7 @@ source = { description = { homepage = "https://github.com/luau-project/lua-uuid", - summary = [[Lightweight, native GUID / UUID library for Lua]],, + summary = [[Lightweight, native GUID / UUID library for Lua]], detailed = [=[ lua-uuid is a lightweight, native library for Lua (5.1 and newer) to deal with Universally Unique Id (UUID). diff --git a/rockspecs/lua-uuid-0.0.2-0.rockspec b/rockspecs/lua-uuid-0.0.2-0.rockspec new file mode 100644 index 0000000..9ddd77b --- /dev/null +++ b/rockspecs/lua-uuid-0.0.2-0.rockspec @@ -0,0 +1,100 @@ +package = "lua-uuid" +version = "0.0.2-0" + +source = { + url = "git://github.com/luau-project/lua-uuid.git", + tag = "v0.0.2" +} + +description = { + homepage = "https://github.com/luau-project/lua-uuid", + summary = [[Lightweight, native GUID / UUID library for Lua]], + detailed = [=[ +lua-uuid is a lightweight, native library for Lua (5.1 and newer) to deal with Universally Unique Id (UUID). + +* On Linux, it uses libuuid to generate UUIDs; +* On Windows, it uses the WINAPI rpcrt4 library; +* On MacOS / iOS, it uses the CoreFoundation framework. + +Visit the GitHub repository for more information.]=], + license = "MIT" +} + +supported_platforms = { "linux", "win32", "mingw", "cygwin", "macosx" } + +dependencies = { + "lua >= 5.1" +} + +external_dependencies = { + platforms = { + linux = { + ["UUID"] = { + header = "uuid/uuid.h" + } + } + } +} + +local function make_plat(plat) + if (plat == "linux") then + return { + type = "builtin", + modules = { + ["lua-uuid"] = { + sources = { "src/lua-uuid.c" }, + libraries = { "uuid" }, + defines = { "LUA_UUID_BUILD_SHARED", "LUA_UUID_USE_LIBUUID" }, + incdirs = { "src", "$(UUID_INCDIR)" }, + libdirs = { "$(UUID_LIBDIR)" } + } + } + } + elseif (plat == "win32" or plat == "mingw" or plat == "cygwin") then + return { + type = "builtin", + modules = { + ["lua-uuid"] = { + sources = { "src/lua-uuid.c" }, + libraries = { "rpcrt4" }, + defines = { "LUA_UUID_BUILD_SHARED", "LUA_UUID_USE_WIN32" }, + incdirs = { "src" }, + libdirs = {} + } + } + } + elseif (plat == "macosx") then + return { + type = "make", + makefile = "Makefile.macosx", + build_variables = { + CFLAGS = "$(CFLAGS)", + LIBFLAG = "$(LIBFLAG)", + CFLAGS_EXTRA = "-DLUA_UUID_USE_APPLE", + LIBFLAG_EXTRA = "-framework CoreFoundation", + LUA_INCDIR = "$(LUA_INCDIR)", + LUA_LIBDIR = "$(LUA_INCDIR)/../lib", + OBJ_EXTENSION = "$(OBJ_EXTENSION)", + LIB_EXTENSION = "$(LIB_EXTENSION)" + }, + install_variables = { + INSTALL_PREFIX = "$(PREFIX)", + INSTALL_LIBDIR = "$(LIBDIR)", + LUA_VERSION = "$(LUA_VERSION)", + LIB_EXTENSION = "$(LIB_EXTENSION)" + } + } + else + error("Unknown platform", 2) + end +end + +build = { + platforms = { + linux = make_plat("linux"), + win32 = make_plat("win32"), + mingw = make_plat("mingw"), + cygwin = make_plat("cygwin"), + macosx = make_plat("macosx") + } +}