Skip to content

Commit 93ee004

Browse files
committed
Update publish-luarocks.yaml and remove generate_rockspec.lua
1 parent 4e72470 commit 93ee004

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.github/workflows/publish-luarocks.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: LuaRocks Release
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
release:
5+
types: [published]
76

87
jobs:
98
release:
@@ -24,7 +23,7 @@ jobs:
2423
2524
- name: Generate rockspec
2625
run: |
27-
lua build/generate_rockspec.lua ${GITHUB_REF#refs/tags/}
26+
sh build/generate_rockspec.sh ${GITHUB_REF#refs/tags/}
2827
2928
- name: Upload to LuaRocks
3029
run: |
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
local args = {...}
2-
local version = args[1]
1+
#!/bin/bash
32

4-
local rockspec = [[
3+
version=$1
4+
5+
rockspec=$(cat <<EOF
56
package = "MathParser"
6-
version = "]]..version..[["
7+
version = "$version"
78
source = {
8-
url = "https://github.com/ByteXenon/MathParser.lua/archive/v]]..version..[[.tar.gz"
9+
url = "https://github.com/ByteXenon/MathParser.lua/archive/v$version.tar.gz"
910
}
1011
description = {
1112
summary = "A math parser for Lua.",
@@ -22,8 +23,7 @@ build = {
2223
["MathParser"] = "MathParser.min.lua"
2324
}
2425
}
25-
]]
26+
EOF
27+
)
2628

27-
local file = io.open("MathParser-"..version..".rockspec", "w")
28-
file:write(rockspec)
29-
file:close()
29+
echo "$rockspec" > "MathParser-$version.rockspec"

0 commit comments

Comments
 (0)