aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-04-17 15:37:43 +0000
committers-ol <s-ol@users.noreply.github.com>2020-04-17 15:42:35 +0000
commitbdad6ca97c079835b4c67b60d71f9a3a539566af (patch)
tree67949bfde18c31d6d4cba141c9d8db55066aec34
parentmore distribution wip (diff)
downloadalive-bdad6ca97c079835b4c67b60d71f9a3a539566af.tar.gz
alive-bdad6ca97c079835b4c67b60d71f9a3a539566af.zip
new windows bundling scheme
-rw-r--r--dist/.gitignore2
-rwxr-xr-xdist/pack-win.sh67
-rwxr-xr-xdist/pack.sh10
-rwxr-xr-xdist/release.sh23
4 files changed, 62 insertions, 40 deletions
diff --git a/dist/.gitignore b/dist/.gitignore
index 7d0e917..59ffb91 100644
--- a/dist/.gitignore
+++ b/dist/.gitignore
@@ -1,2 +1,2 @@
*.zip
-deps
+*.rock
diff --git a/dist/pack-win.sh b/dist/pack-win.sh
index f0f9ae2..9157a07 100755
--- a/dist/pack-win.sh
+++ b/dist/pack-win.sh
@@ -1,42 +1,50 @@
#!/bin/sh
-VERSION="$1"
-BUNDLE="alive-$VERSION-win"
+TAG="$1"
+ROCKVER="$2"
+
+BUNDLE="alive-$TAG-win"
+ROCK="alive-$ROCKVER.all.rock"
set -e
-if [ -d "dist/$BUNDLE.zip" ]; then
+if [ -e "dist/$BUNDLE.zip" ]; then
echo "dist/$BUNDLE.zip already exists!"
exit 2
fi
-# luarocks --tree lua/lua install --deps-mode none ../../alive-scm-1.all.rock
-
-git archive "$VERSION:" -o "dist/$BUNDLE.zip" --prefix "$BUNDLE/alive/"
-
-cd dist
-unzip "$BUNDLE.zip"
-cd "$BUNDLE"
+if [ -e "dist/$BUNDLE" ]; then
+ echo "dist/$BUNDLE already exists!"
+ exit 2
+fi
-cp -r ../../docs .
-mv alive/hello.alv .
-rm -rf docs/*.md docs/*.ltp docs/gen
-rm -rf alive/dist
+mkdir -p "dist/$BUNDLE"
-unzip ../lua-win.zip
+cp -r docs hello.alv LICENSE "dist/$BUNDLE/"
+rm -rf "dist/$BUNDLE/docs/"*.md "dist/$BUNDLE/docs/"*.ltp "dist/$BUNDLE/docs/gen"
+unzip dist/lua-win.zip -d "dist/$BUNDLE/"
+luarocks --tree "dist/$BUNDLE/lua/lua" install --deps-mode none "dist/rocks/$ROCK"
-cat <<EOF >copilot.bat
+cat <<EOF >"dist/$BUNDLE/copilot.bat"
@echo off
setlocal
-set PATH=%PATH%;%~dp0\lua\lua\bin
-set LUA_PATH=%LUA_PATH%;%~dp0\alive\?.lua;%~dp0\alive\?\init.lua
-moon %~dp0\alive\init.moon %*
+set PATH=%PATH%;%~dp0\\lua\\lua\\bin
+set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\?\init.lua
+moon "%~dp0\\lua\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv" %*
exit /b %ERRORLEVEL%
EOF
-cat <<EOF >README.md
-alivecoding $VERSION
-====================
+mkdir "dist/$BUNDLE/alv-lib"
+cat <<EOF >"dist/$BUNDLE/alv-lib/README.txt"
+You can use this directory to add extensions to alive.
+See the extension documentation here for more information:
+
+https://alive.s-ol.nu/internals/topics/extensions.md.html
+EOF
+
+cat <<EOF >"dist/$BUNDLE/README.md"
+alivecoding $TAG
+================
https://alive.s-ol.nu
https://github.com/s-ol/alivecoding
@@ -44,19 +52,20 @@ https://github.com/s-ol/alivecoding
License
-------
alive is licensed under the GPLv3 free and open-source license, a copy of which
-you can find in the file \`alive/LICENSE\`.
+you can find in the file \`LICENSE\`.
This binary distribution of alive contains the Lua interpreter, LuaRocks package
manager, and a number of Lua modules licensed under various terms. Lua and
-LuaRocks are both licensed under the MIT license, while the packages can be
-found within the \`lua/lua\` directory while their individual licensing
-information may be viewed using \`luarocks.bat\`:
+LuaRocks are both licensed under the MIT license. The packages can be found
+within the \`lua/lua\` directory while their individual licensing information
+may be viewed using \`luarocks.bat\`:
cmd.exe> luarocks.bat list
cmd.exe> luarocks.bat show moonscript
cmd.exe> luarocks.bat show ...
EOF
-cd ..
-rm "$BUNDLE.zip"
-# zip -rm "$BUNDLE.zip" "$BUNDLE"
+(
+ cd dist/
+ zip -rm "$BUNDLE.zip" "$BUNDLE"
+)
diff --git a/dist/pack.sh b/dist/pack.sh
index b76f2d6..81a873e 100755
--- a/dist/pack.sh
+++ b/dist/pack.sh
@@ -1,13 +1,17 @@
#!/bin/sh
set -e
-VERSION="$1"
+TAG="$1"
REVISION="${2:-1}"
-VERSION="${VERSION#v}"
+VERSION="${TAG#v}"
VERSION=$(echo "$VERSION" | tr -d -)
+ROCKVER="$VERSION-$REVISION"
-luarocks build "dist/rocks/alive-$VERSION-$REVISION.rockspec" \
+luarocks build "dist/rocks/alive-$ROCKVER.rockspec" \
--pack-binary-rock \
--sign \
--pin
+mv "alive-$ROCKVER.all.rock" "alive-$ROCKVER.all.rock.asc" dist/rocks
+
+dist/pack-win.sh "$TAG" "$ROCKVER"
diff --git a/dist/release.sh b/dist/release.sh
index 1aaa978..c7d9fa4 100755
--- a/dist/release.sh
+++ b/dist/release.sh
@@ -1,13 +1,20 @@
#!/bin/sh
set -e
-VERSION="${1:-scm}"
+TAG="${1:-scm}"
REVISION="${2:-1}"
if [ "$VERSION" = scm ]; then
WHERE=
+ VERSION="scm"
else
- git tag "$VERSION"
+ VERSION="${TAG#v}"
+ VERSION=$(echo "$VERSION" | tr -d -)
+
+ if [ ! -z "$(git status --porcelain)" ]; then
+ echo "working directory not clean!"
+ exit 2
+ fi
cat <<EOF >"alv/version.moon"
----
@@ -22,17 +29,19 @@ else
-- @tfield string repo the git repo URL
-- @tfield string release the web URL of this release
{
- tag: "${VERSION}"
+ tag: "${TAG}"
web: "https://github.com/s-ol/alivecoding"
repo: "https://github.com/s-ol/alivecoding.git"
- release: "https://github.com/s-ol/alivecoding/releases/tag/${VERSION}"
+ release: "https://github.com/s-ol/alivecoding/releases/tag/${TAG}"
}
EOF
WHERE="
- tag = \"$VERSION\","
- VERSION="${VERSION#v}"
- VERSION=$(echo "$VERSION" | tr -d -)
+ tag = \"$TAG\","
+
+ git add "alv/version.moon"
+ git commit -m "relase $TAG"
+ git tag -am "version $TAG" "$TAG"
fi
list_modules() {