aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-11-01 10:15:25 +0800
committerLi Jin <dragon-fly@qq.com>2023-11-01 10:15:25 +0800
commit701f1fbcba10e0700728dd466778defc784f164d (patch)
tree666e472a824e3f9a21eaae710977704750fab664 /spec/inputs
parentd092bafc74a851939925ec2d40a8bd364b607d68 (diff)
downloadyuescript-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.yue55
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 @@
1luarocksKey = ...
2local version
3with? io.open "src/yuescript/yue_compiler.cpp"
4 codes = \read "*a"
5 \close!
6 version = codes\match "const std::string_view version = \"(.-)\"sv;"
7unless version?
8 print "failed to get version!"
9 os.exit 1
10
11rockspec = "rockspec_format = '3.0'
12package = 'Yuescript'
13version = '#{version}-1'
14source = {
15 url = 'git+https://github.com/pigpigyyy/yuescript'
16}
17description = {
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}
26dependencies = {
27 'lua >= 5.1',
28}
29build = {
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
46specFile = "yuescript-#{version}-1.rockspec"
47with? io.open specFile, "w+"
48 \write rockspec
49 \close!
50
51result = io.popen("luarocks upload --api-key #{luarocksKey} #{specFile}")\read '*a'
52unless result\match "Done:"
53 print result
54 os.exit 1
55