Skip to content

Commit

Permalink
Add version updating infrastructure for 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alloyed committed Oct 31, 2020
1 parent 0161e61 commit ff3f90c
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua-lsp-scm-1.rockspec → lua-lsp-scm-0.rockspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package = "lua-lsp"
version = "scm-1"
version = "scm-0"
source = {
url = "git://github.com/Alloyed/lua-lsp"
}
Expand Down
54 changes: 54 additions & 0 deletions rockspecs/lua-lsp-0.1.0-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package = "lua-lsp"
version = "0.1.0-1"
source = {
url = "git://github.com/Alloyed/lua-lsp",
tag = "v0.1.0",
}
description = {
summary = "A Language Server implementation for lua, the language",
detailed = [[
A Language Server for Lua code, written in Lua.
It's still a work in progress, but it's usable for day-to-day. It currently
supports:
* Limited autocompletion
* Goto definition
* As you type linting and syntax checking
* Code formatting
* Supports Lua 5.1-5.3 and Luajit
]],
homepage = "https://github.com/Alloyed/lua-lsp",
license = "MIT"
}
dependencies = {
"lua >= 5.1, < 5.4",
"dkjson ~> 2.5",
"lpeglabel ~> 1.6",
"inspect ~> 3.1"
}
build = {
type = "builtin",
modules = {
["lua-lsp.analyze"] = "lua-lsp/analyze.lua",
["lua-lsp.data.5_1"] = "lua-lsp/data/5_1.lua",
["lua-lsp.data.5_2"] = "lua-lsp/data/5_2.lua",
["lua-lsp.data.5_3"] = "lua-lsp/data/5_3.lua",
["lua-lsp.data._test"] = "lua-lsp/data/_test.lua",
["lua-lsp.data.love-completions"] = "lua-lsp/data/love-completions.lua",
["lua-lsp.data.luajit-2_0"] = "lua-lsp/data/luajit-2_0.lua",
["lua-lsp.formatting"] = "lua-lsp/formatting.lua",
["lua-lsp.log"] = "lua-lsp/log.lua",
["lua-lsp.loop"] = "lua-lsp/loop.lua",
["lua-lsp.lua-parser.parser"] = "lua-lsp/lua-parser/parser.lua",
["lua-lsp.lua-parser.scope"] = "lua-lsp/lua-parser/scope.lua",
["lua-lsp.lua-parser.validator"] = "lua-lsp/lua-parser/validator.lua",
["lua-lsp.methods"] = "lua-lsp/methods.lua",
["lua-lsp.rpc"] = "lua-lsp/rpc.lua",
["lua-lsp.unicode"] = "lua-lsp/unicode.lua"
},
install = {
bin = {
"bin/lua-lsp"
}
}
}
Binary file added rockspecs/lua-lsp-0.1.0-1.src.rock
Binary file not shown.
55 changes: 55 additions & 0 deletions rockspecs/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

_version="$1"

if [ -z "$_version" ]; then
echo "Version number required, format x.y.z"
exit 1
fi

tags=$(git tag -l "v$_version")
if [ -n "${tags//}" ]; then
echo "Tag v$_version exists"
exit 1
fi

read -r -d '' script <<EOT
local a = "$1"
if a:match('^%d+%.%d+%.%d+-%d+') then
print(a)
elseif a:match('^%d+%.%d+%.%d$') then
print(a .."-1")
else
error('invalid argument')
end
EOT

set -e
_rspec_ver=$(lua -e "$script")
git pull

echo "::Updating to $_version, rockspec version $_rspec_ver"

echo "::Performing tests"
busted

echo "::Generating rockspec"
cd rockspecs
luarocks new_version ../lua-lsp-scm-0.rockspec $_rspec_ver

rspec=lua-lsp-${_rspec_ver}.rockspec
echo "-- MOVE tag = \"v${_version}\"" >> $rspec
$EDITOR $rspec
luarocks lint $rspec
cd ..

echo "::Adding tag"
git tag -a "v$_version" -m "Version $_version"

echo <<END
::Done. Upload with
git push origin master --tags
luarocks upload \"rockspecs/${rspec}\"
::Undo with
git reset --hard HEAD~1 && git tag -d "v$_version"
END

0 comments on commit ff3f90c

Please sign in to comment.