aboutsummaryrefslogtreecommitdiff
path: root/lib/actions/dist.bash
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-03-22 11:48:23 +0100
committerPatrick Spek <p.spek@tyil.nl>2020-03-22 11:48:23 +0100
commit1d983e9f934bf6aeb9333c763fe1a603b8d8e5c4 (patch)
treeff96afaf569e8669a28ba35e85a1441621117d0b /lib/actions/dist.bash
Initial commit
Diffstat (limited to 'lib/actions/dist.bash')
-rw-r--r--lib/actions/dist.bash48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/actions/dist.bash b/lib/actions/dist.bash
new file mode 100644
index 0000000..3b06b4f
--- /dev/null
+++ b/lib/actions/dist.bash
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+RSTAR_DEPS_BIN+=(
+ git
+ tar
+)
+
+action() {
+ local version="${1:-$(date +%Y.%m)}"
+ WORKDIR="$BASEDIR/tmp/rakudo-star-$version"
+
+ info "Creating distribution contents at $WORKDIR"
+
+ cd -- "$BASEDIR"
+
+ # Include files from this project
+ for file in $(git ls-files)
+ do
+ dist_include "/$file"
+ done
+
+ # Include the sources of all components
+ for src in dist/src/*
+ do
+ dist_include "/$src"
+ done
+
+ # Add a MANIFEST.txt
+ cd -- "$WORKDIR"
+ find . > MANIFEST.txt
+
+ # Tar it all up into a distribution tarball
+ info "Creating tarball out of $WORKDIR"
+
+ local tarball="$BASEDIR/dist/rakudo-star-$version.tar.gz"
+
+ mkdir -p -- "$(dirname "$tarball")"
+ cd -- "$BASEDIR/tmp"
+
+ tar czf "$tarball" "rakudo-star-$version"
+
+ info "Distribution tarball available at $tarball"
+}
+
+dist_include() {
+ mkdir -p -- "$(dirname "${WORKDIR}$1")"
+ cp -r -- "${BASEDIR}$1" "${WORKDIR}$1"
+}