diff options
author | Li Jin <dragon-fly@qq.com> | 2023-11-01 10:15:25 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-11-01 10:15:25 +0800 |
commit | 701f1fbcba10e0700728dd466778defc784f164d (patch) | |
tree | 666e472a824e3f9a21eaae710977704750fab664 /spec/inputs | |
parent | d092bafc74a851939925ec2d40a8bd364b607d68 (diff) | |
download | yuescript-701f1fbcba10e0700728dd466778defc784f164d.tar.gz yuescript-701f1fbcba10e0700728dd466778defc784f164d.tar.bz2 yuescript-701f1fbcba10e0700728dd466778defc784f164d.zip |
add luarocks upload. [skip CI]
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/luarocks_upload.yue | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/spec/inputs/luarocks_upload.yue b/spec/inputs/luarocks_upload.yue new file mode 100644 index 0000000..30e8434 --- /dev/null +++ b/spec/inputs/luarocks_upload.yue | |||
@@ -0,0 +1,55 @@ | |||
1 | luarocksKey = ... | ||
2 | local version | ||
3 | with? io.open "src/yuescript/yue_compiler.cpp" | ||
4 | codes = \read "*a" | ||
5 | \close! | ||
6 | version = codes\match "const std::string_view version = \"(.-)\"sv;" | ||
7 | unless version? | ||
8 | print "failed to get version!" | ||
9 | os.exit 1 | ||
10 | |||
11 | rockspec = "rockspec_format = '3.0' | ||
12 | package = 'Yuescript' | ||
13 | version = '#{version}-1' | ||
14 | source = { | ||
15 | url = 'git+https://github.com/pigpigyyy/yuescript' | ||
16 | } | ||
17 | description = { | ||
18 | summary = 'Yuescript is a Moonscript dialect.', | ||
19 | detailed = [[ | ||
20 | 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. ]], | ||
21 | homepage = 'https://github.com/pigpigyyy/yuescript', | ||
22 | maintainer = 'Li Jin <dragon-fly@qq.com>', | ||
23 | labels = {'yuescript','cpp','transpiler','moonscript'}, | ||
24 | license = 'MIT' | ||
25 | } | ||
26 | dependencies = { | ||
27 | 'lua >= 5.1', | ||
28 | } | ||
29 | build = { | ||
30 | type = 'cmake', | ||
31 | variables = { | ||
32 | LUA='$(LUA)', | ||
33 | LUA_INCDIR='$(LUA_INCDIR)', | ||
34 | CMAKE_BUILD_TYPE='Release' | ||
35 | }, | ||
36 | install = { | ||
37 | lib = { | ||
38 | 'build.luarocks/yue.so' | ||
39 | }, | ||
40 | bin = { | ||
41 | 'build.luarocks/yue' | ||
42 | } | ||
43 | } | ||
44 | }" | ||
45 | |||
46 | specFile = "yuescript-#{version}-1.rockspec" | ||
47 | with? io.open specFile, "w+" | ||
48 | \write rockspec | ||
49 | \close! | ||
50 | |||
51 | result = io.popen("luarocks upload --api-key #{luarocksKey} #{specFile}")\read '*a' | ||
52 | unless result\match "Done:" | ||
53 | print result | ||
54 | os.exit 1 | ||
55 | |||