Files

56 lines
1.8 KiB
Bash
Raw Permalink Normal View History

2021-12-11 01:44:01 +01:00
#!/bin/bash
2021-12-16 16:01:17 +01:00
if [ ! -f spark.phar ]; then
echo "error: No spark.phar has been built yet?"
exit 1
fi
2021-12-17 12:51:29 +01:00
if [ -z "$VERSION" ]; then
VERSION="$(git describe --tags)"
2021-12-30 00:53:08 +01:00
if [ -z "$VERSION" ]; then
echo "Could not parse version from git. Export VERSION if you are building manually."
exit 1
fi
2021-12-17 12:51:29 +01:00
fi
2021-12-30 00:53:08 +01:00
echo "* Version: $VERSION"
if [ ! -z "$FLAVOR" ]; then
VERSION="${VERSION}-${FLAVOR}"
echo "* Flavor: $FLAVOR"
2021-12-11 01:44:01 +01:00
fi
2021-12-30 00:53:08 +01:00
PATH="$PWD/tools:$PATH"
2022-01-06 17:20:40 +01:00
PLUGINS="plugins/com.noccy.apiclient plugins/com.noccy.pdo plugins/com.noccy.todo plugins/com.noccy.pdo.shell plugins/com.noccy.watcher"
2021-12-30 00:53:08 +01:00
2021-12-11 01:44:01 +01:00
if [ -z $DESTINATION ]; then
DESTINATION="release/$VERSION"
fi
echo " DESTINATION=$DESTINATION"
echo "* Preparing release direcory"
mkdir -p $DESTINATION
echo "* Copying files to release directory"
cp spark.phar $DESTINATION/spark.phar
cp README.md $DESTINATION/README.md
cp VERSIONS.md $DESTINATION/VERSIONS.md
echo "* Building dist and source archives"
2022-01-06 17:20:40 +01:00
7z a -tzip "$DESTINATION/spark-$VERSION-dist.zip" spark.phar $PLUGINS README.md VERSIONS.md >/dev/null
tar cfz "$DESTINATION/spark-$VERSION-dist.tgz" spark.phar $PLUGINS README.md VERSIONS.md
7z a -tzip "$DESTINATION/spark-$VERSION-src.zip" bin src runtime $PLUGINS composer.json README.md VERSIONS.md >/dev/null
tar cfz "$DESTINATION/spark-$VERSION-src.tgz" bin src runtime $PLUGINS composer.json README.md VERSIONS.md
2021-12-11 01:44:01 +01:00
echo "* Creating makeself installer"
test -d release/tmp && rm -rf release/tmp
mkdir release/tmp
2022-01-06 17:20:40 +01:00
cp -R spark.phar $PLUGINS README.md VERSIONS.md release/tmp/
2021-12-11 01:44:01 +01:00
pushd release/tmp &>/dev/null
makeself . ../../$DESTINATION/spark-$VERSION-dist.run "Spark $VERSION" ./spark.phar install &>/dev/null
popd &>/dev/null
rm -rf release/tmp
echo -e " ┌─[$DESTINATION]"
ls -hl --color=auto $DESTINATION | sed "s/^/ │ /"