File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : LuaRocks Release
2+ on :
3+ release :
4+ types : [created]
5+ jobs :
6+ release :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - name : Checkout code
10+ uses : actions/checkout@v2
11+ - name : Set up Lua
12+ uses : leafo/gh-actions-lua@v8
13+ with :
14+ luaVersion : " 5.4.0"
15+ - name : Delete old rockspec files
16+ run : |
17+ git rm MathParser-*.rockspec || true
18+ - name : Generate rockspec
19+ run : |
20+ lua generate_rockspec.lua ${GITHUB_REF#refs/tags/}
21+ - name : Upload to LuaRocks
22+ run : |
23+ luarocks upload --api-key ${{ secrets.LUAROCKS_API_KEY }} MathParser-${GITHUB_REF#refs/tags/}.rockspec
24+ - name : Add rockspec to repository
25+ run : |
26+ git config --local user.email "action@github.com"
27+ git config --local user.name "GitHub Action"
28+ git add MathParser-${GITHUB_REF#refs/tags/}.rockspec
29+ git commit -m "Add rockspec for version ${GITHUB_REF#refs/tags/}"
30+ git push
Original file line number Diff line number Diff line change 1+ local args = {... }
2+ local version = args [1 ]
3+
4+ local rockspec = [[
5+ package = "MathParser"
6+ version = "]] .. version .. [[ "
7+ source = {
8+ url = "https://github.com/ByteXenon/MathParser.lua/archive/v]] .. version .. [[ .tar.gz"
9+ }
10+ description = {
11+ summary = "A math parser for Lua.",
12+ detailed = "An elegant Math Parser written in Lua, featuring support for adding custom operators and functions.",
13+ homepage = "https://github.com/ByteXenon/MathParser.lua",
14+ license = "MIT"
15+ }
16+ dependencies = {
17+ "lua >= 5.1"
18+ }
19+ build = {
20+ type = "builtin",
21+ modules = {
22+ ["MathParser"] = "MathParser.min.lua"
23+ }
24+ }
25+ ]]
26+
27+ local file = io.open (" MathParser-" .. version .. " .rockspec" , " w" )
28+ file :write (rockspec )
29+ file :close ()
You can’t perform that action at this time.
0 commit comments