Skip to content

Commit

Permalink
Update publish-luarocks.yaml and remove generate_rockspec.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
bytexenon committed May 21, 2024
1 parent 4e72470 commit 93ee004
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/publish-luarocks.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: LuaRocks Release

on:
push:
branches:
- main
release:
types: [published]

jobs:
release:
Expand All @@ -24,7 +23,7 @@ jobs:
- name: Generate rockspec
run: |
lua build/generate_rockspec.lua ${GITHUB_REF#refs/tags/}
sh build/generate_rockspec.sh ${GITHUB_REF#refs/tags/}
- name: Upload to LuaRocks
run: |
Expand Down
18 changes: 9 additions & 9 deletions build/generate_rockspec.lua → build/generate_rockspec.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
local args = {...}
local version = args[1]
#!/bin/bash

local rockspec = [[
version=$1

rockspec=$(cat <<EOF
package = "MathParser"
version = "]]..version..[["
version = "$version"
source = {
url = "https://github.com/ByteXenon/MathParser.lua/archive/v]]..version..[[.tar.gz"
url = "https://github.com/ByteXenon/MathParser.lua/archive/v$version.tar.gz"
}
description = {
summary = "A math parser for Lua.",
Expand All @@ -22,8 +23,7 @@ build = {
["MathParser"] = "MathParser.min.lua"
}
}
]]
EOF
)

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

0 comments on commit 93ee004

Please sign in to comment.