git.s-ol.nu alive / bdad6ca
new windows bundling scheme s-ol 1 year, 2 months ago
4 changed file(s) with 62 addition(s) and 40 deletion(s). Raw diff Collapse all Expand all
00 *.zip
1 deps
1 *.rock
00 #!/bin/sh
11
2 VERSION="$1"
3 BUNDLE="alive-$VERSION-win"
2 TAG="$1"
3 ROCKVER="$2"
4
5 BUNDLE="alive-$TAG-win"
6 ROCK="alive-$ROCKVER.all.rock"
47
58 set -e
69
7 if [ -d "dist/$BUNDLE.zip" ]; then
10 if [ -e "dist/$BUNDLE.zip" ]; then
811 echo "dist/$BUNDLE.zip already exists!"
912 exit 2
1013 fi
1114
12 # luarocks --tree lua/lua install --deps-mode none ../../alive-scm-1.all.rock
15 if [ -e "dist/$BUNDLE" ]; then
16 echo "dist/$BUNDLE already exists!"
17 exit 2
18 fi
1319
14 git archive "$VERSION:" -o "dist/$BUNDLE.zip" --prefix "$BUNDLE/alive/"
20 mkdir -p "dist/$BUNDLE"
1521
16 cd dist
17 unzip "$BUNDLE.zip"
18 cd "$BUNDLE"
22 cp -r docs hello.alv LICENSE "dist/$BUNDLE/"
23 rm -rf "dist/$BUNDLE/docs/"*.md "dist/$BUNDLE/docs/"*.ltp "dist/$BUNDLE/docs/gen"
24 unzip dist/lua-win.zip -d "dist/$BUNDLE/"
25 luarocks --tree "dist/$BUNDLE/lua/lua" install --deps-mode none "dist/rocks/$ROCK"
1926
20 cp -r ../../docs .
21 mv alive/hello.alv .
22 rm -rf docs/*.md docs/*.ltp docs/gen
23 rm -rf alive/dist
24
25 unzip ../lua-win.zip
26
27 cat <<EOF >copilot.bat
27 cat <<EOF >"dist/$BUNDLE/copilot.bat"
2828 @echo off
2929 setlocal
30 set PATH=%PATH%;%~dp0\lua\lua\bin
31 set LUA_PATH=%LUA_PATH%;%~dp0\alive\?.lua;%~dp0\alive\?\init.lua
32 moon %~dp0\alive\init.moon %*
30 set PATH=%PATH%;%~dp0\\lua\\lua\\bin
31 set LUA_PATH=%LUA_PATH%;%~dp0\?.lua;%~dp0\?\init.lua
32 moon "%~dp0\\lua\\lua\\lib\\luarocks\\rocks-5.3\\alive\\$ROCKVER\\bin\\alv" %*
3333 exit /b %ERRORLEVEL%
3434 EOF
3535
36 cat <<EOF >README.md
37 alivecoding $VERSION
38 ====================
36 mkdir "dist/$BUNDLE/alv-lib"
37 cat <<EOF >"dist/$BUNDLE/alv-lib/README.txt"
38 You can use this directory to add extensions to alive.
39 See the extension documentation here for more information:
40
41 https://alive.s-ol.nu/internals/topics/extensions.md.html
42 EOF
43
44 cat <<EOF >"dist/$BUNDLE/README.md"
45 alivecoding $TAG
46 ================
3947
4048 https://alive.s-ol.nu
4149 https://github.com/s-ol/alivecoding
4351 License
4452 -------
4553 alive is licensed under the GPLv3 free and open-source license, a copy of which
46 you can find in the file \`alive/LICENSE\`.
54 you can find in the file \`LICENSE\`.
4755
4856 This binary distribution of alive contains the Lua interpreter, LuaRocks package
4957 manager, and a number of Lua modules licensed under various terms. Lua and
50 LuaRocks are both licensed under the MIT license, while the packages can be
51 found within the \`lua/lua\` directory while their individual licensing
52 information may be viewed using \`luarocks.bat\`:
58 LuaRocks are both licensed under the MIT license. The packages can be found
59 within the \`lua/lua\` directory while their individual licensing information
60 may be viewed using \`luarocks.bat\`:
5361
5462 cmd.exe> luarocks.bat list
5563 cmd.exe> luarocks.bat show moonscript
5664 cmd.exe> luarocks.bat show ...
5765 EOF
5866
59 cd ..
60 rm "$BUNDLE.zip"
61 # zip -rm "$BUNDLE.zip" "$BUNDLE"
67 (
68 cd dist/
69 zip -rm "$BUNDLE.zip" "$BUNDLE"
70 )
00 #!/bin/sh
11 set -e
22
3 VERSION="$1"
3 TAG="$1"
44 REVISION="${2:-1}"
55
6 VERSION="${VERSION#v}"
6 VERSION="${TAG#v}"
77 VERSION=$(echo "$VERSION" | tr -d -)
8 ROCKVER="$VERSION-$REVISION"
89
9 luarocks build "dist/rocks/alive-$VERSION-$REVISION.rockspec" \
10 luarocks build "dist/rocks/alive-$ROCKVER.rockspec" \
1011 --pack-binary-rock \
1112 --sign \
1213 --pin
14 mv "alive-$ROCKVER.all.rock" "alive-$ROCKVER.all.rock.asc" dist/rocks
15
16 dist/pack-win.sh "$TAG" "$ROCKVER"
00 #!/bin/sh
11 set -e
22
3 VERSION="${1:-scm}"
3 TAG="${1:-scm}"
44 REVISION="${2:-1}"
55
66 if [ "$VERSION" = scm ]; then
77 WHERE=
8 VERSION="scm"
89 else
9 git tag "$VERSION"
10 VERSION="${TAG#v}"
11 VERSION=$(echo "$VERSION" | tr -d -)
12
13 if [ ! -z "$(git status --porcelain)" ]; then
14 echo "working directory not clean!"
15 exit 2
16 fi
1017
1118 cat <<EOF >"alv/version.moon"
1219 ----
2128 -- @tfield string repo the git repo URL
2229 -- @tfield string release the web URL of this release
2330 {
24 tag: "${VERSION}"
31 tag: "${TAG}"
2532 web: "https://github.com/s-ol/alivecoding"
2633 repo: "https://github.com/s-ol/alivecoding.git"
27 release: "https://github.com/s-ol/alivecoding/releases/tag/${VERSION}"
34 release: "https://github.com/s-ol/alivecoding/releases/tag/${TAG}"
2835 }
2936 EOF
3037
3138 WHERE="
32 tag = \"$VERSION\","
33 VERSION="${VERSION#v}"
34 VERSION=$(echo "$VERSION" | tr -d -)
39 tag = \"$TAG\","
40
41 git add "alv/version.moon"
42 git commit -m "relase $TAG"
43 git tag -am "version $TAG" "$TAG"
3544 fi
3645
3746 list_modules() {