diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-02-22 02:10:26 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-02-22 02:12:46 +0800 |
| commit | 0f75a9573821933f7829d250a99fcfa353ab7518 (patch) | |
| tree | 93124a740cad143d70f70bb0f490a1645ce22c48 /spec/outputs | |
| parent | 58baf3ef323026b3ffc46ce480ceba4c0997fae3 (diff) | |
| download | yuescript-0.33.1.tar.gz yuescript-0.33.1.tar.bz2 yuescript-0.33.1.zip | |
Fixed some scripts.v0.33.1
Fix.
Diffstat (limited to '')
| -rw-r--r-- | spec/outputs/compile_doc.lua | 2 | ||||
| -rw-r--r-- | spec/outputs/luarocks_upload.lua | 25 |
2 files changed, 25 insertions, 2 deletions
diff --git a/spec/outputs/compile_doc.lua b/spec/outputs/compile_doc.lua index f661bbd..470257d 100644 --- a/spec/outputs/compile_doc.lua +++ b/spec/outputs/compile_doc.lua | |||
| @@ -45,7 +45,7 @@ getFiles = function(locale) | |||
| 45 | "doc/docs/" .. tostring(locale) .. "doc/language-basics/literals.md", | 45 | "doc/docs/" .. tostring(locale) .. "doc/language-basics/literals.md", |
| 46 | "doc/docs/" .. tostring(locale) .. "doc/language-basics/module.md", | 46 | "doc/docs/" .. tostring(locale) .. "doc/language-basics/module.md", |
| 47 | "doc/docs/" .. tostring(locale) .. "doc/reference/license-mit.md", | 47 | "doc/docs/" .. tostring(locale) .. "doc/reference/license-mit.md", |
| 48 | "doc/docs/" .. tostring(locale) .. "doc/reference/the-yuescript-library.md" | 48 | "doc/docs/" .. tostring(locale) .. "doc/advanced/the-yuescript-library.md" |
| 49 | } | 49 | } |
| 50 | end | 50 | end |
| 51 | local docs | 51 | local docs |
diff --git a/spec/outputs/luarocks_upload.lua b/spec/outputs/luarocks_upload.lua index 96988d7..7fa2f73 100644 --- a/spec/outputs/luarocks_upload.lua +++ b/spec/outputs/luarocks_upload.lua | |||
| @@ -12,7 +12,28 @@ if not (version ~= nil) then | |||
| 12 | print("failed to get version!") | 12 | print("failed to get version!") |
| 13 | os.exit(1) | 13 | os.exit(1) |
| 14 | end | 14 | end |
| 15 | local rockspec = "rockspec_format = '3.0'\npackage = 'Yuescript'\nversion = '" .. tostring(version) .. "-1'\nsource = {\n url = 'git+https://github.com/pigpigyyy/yuescript'\n}\ndescription = {\n summary = 'Yuescript is a Moonscript dialect.',\n detailed = [[\n Yuescript is a Moonscript dialect. It is derived from Moonscript language 0.5.0 and continuously adopting new features to be more up to date. ]],\n homepage = 'https://github.com/pigpigyyy/yuescript',\n maintainer = 'Li Jin <dragon-fly@qq.com>',\n labels = {'yuescript','cpp','transpiler','moonscript'},\n license = 'MIT'\n}\ndependencies = {\n 'lua >= 5.1',\n}\nbuild = {\n type = 'cmake',\n variables = {\n LUA='$(LUA)',\n LUA_INCDIR='$(LUA_INCDIR)',\n CMAKE_BUILD_TYPE='Release'\n },\n install = {\n lib = {\n 'build.luarocks/yue.so'\n },\n bin = {\n 'build.luarocks/yue'\n }\n }\n}" | 15 | local tmpBase = os.getenv("RUNNER_TEMP") or os.getenv("TMPDIR") or "/tmp" |
| 16 | local pkgRoot = tostring(tmpBase) .. "/yuescript_pack_" .. tostring(version) | ||
| 17 | local srcDir = tostring(pkgRoot) .. "/yuescript-" .. tostring(version) | ||
| 18 | local tarFile = tostring(pkgRoot) .. "/yuescript-" .. tostring(version) .. ".tar.gz" | ||
| 19 | local run | ||
| 20 | run = function(cmd) | ||
| 21 | print(cmd) | ||
| 22 | local ok = os.execute(cmd) | ||
| 23 | if not (ok == true or ok == 0) then | ||
| 24 | print("Command failed!") | ||
| 25 | return os.exit(1) | ||
| 26 | end | ||
| 27 | end | ||
| 28 | run("rm -rf '" .. tostring(pkgRoot) .. "'") | ||
| 29 | run("mkdir -p '" .. tostring(srcDir) .. "'") | ||
| 30 | run("cp CMakeLists.txt '" .. tostring(srcDir) .. "/'") | ||
| 31 | run("cp README.md '" .. tostring(srcDir) .. "/'") | ||
| 32 | run("cp LICENSE '" .. tostring(srcDir) .. "/'") | ||
| 33 | run("cp -R src '" .. tostring(srcDir) .. "/'") | ||
| 34 | run("tar -C '" .. tostring(pkgRoot) .. "' -czf '" .. tostring(tarFile) .. "' 'yuescript-" .. tostring(version) .. "'") | ||
| 35 | local sourceUrl = "file://" .. tostring(tarFile) | ||
| 36 | local rockspec = "rockspec_format = '3.0'\npackage = 'Yuescript'\nversion = '" .. tostring(version) .. "-1'\nsource = {\n url = '" .. tostring(sourceUrl) .. "'\n}\ndescription = {\n summary = 'Yuescript is a Moonscript dialect.',\n detailed = [[\n Yuescript is a Moonscript dialect. It is derived from Moonscript language 0.5.0 and continuously adopting new features to be more up to date. ]],\n homepage = 'https://github.com/IppClub/YueScript',\n maintainer = 'Li Jin <dragon-fly@qq.com>',\n labels = {'yuescript','cpp','transpiler','moonscript'},\n license = 'MIT'\n}\ndependencies = {\n 'lua >= 5.1',\n}\nbuild = {\n type = 'cmake',\n variables = {\n LUA = '$(LUA)',\n LUA_INCDIR = '$(LUA_INCDIR)',\n CMAKE_BUILD_TYPE='Release'\n },\n install = {\n lib = {\n 'build.luarocks/yue.so'\n },\n bin = {\n 'build.luarocks/yue'\n }\n },\n platforms = {\n windows = {\n install = {\n lib = {\n 'build.luarocks/Release/yue.dll'\n },\n bin = {\n 'build.luarocks/Release/yue.exe'\n }\n }\n }\n }\n}" | ||
| 16 | local specFile = "yuescript-" .. tostring(version) .. "-1.rockspec" | 37 | local specFile = "yuescript-" .. tostring(version) .. "-1.rockspec" |
| 17 | do | 38 | do |
| 18 | local _with_0 = io.open(specFile, "w+") | 39 | local _with_0 = io.open(specFile, "w+") |
| @@ -21,6 +42,8 @@ do | |||
| 21 | _with_0:close() | 42 | _with_0:close() |
| 22 | end | 43 | end |
| 23 | end | 44 | end |
| 45 | print("Using source: " .. tostring(sourceUrl)) | ||
| 46 | print("Uploading rockspec: " .. tostring(specFile)) | ||
| 24 | local result = io.popen("luarocks upload --api-key " .. tostring(luarocksKey) .. " " .. tostring(specFile)):read('*a') | 47 | local result = io.popen("luarocks upload --api-key " .. tostring(luarocksKey) .. " " .. tostring(specFile)):read('*a') |
| 25 | if not result:match("Done:") then | 48 | if not result:match("Done:") then |
| 26 | print(result) | 49 | print(result) |
