summaryrefslogtreecommitdiff
path: root/.github/scripts/init-pre-release.sh
diff options
context:
space:
mode:
Diffstat (limited to '.github/scripts/init-pre-release.sh')
-rwxr-xr-x.github/scripts/init-pre-release.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/.github/scripts/init-pre-release.sh b/.github/scripts/init-pre-release.sh
index 7a86f3052c..c7b7cab617 100755
--- a/.github/scripts/init-pre-release.sh
+++ b/.github/scripts/init-pre-release.sh
@@ -3,4 +3,33 @@
## We create a tar ball that is used later by build-otp-tar
## to create the pre-built tar ball
-git archive --prefix otp/ -o otp_src.tar.gz HEAD
+AUTOCONF=0
+TARGET=otp_src.tar.gz
+
+if [ -n "$1" ]; then
+ TARGET="$1"
+fi
+
+## This script is used to create archives for older releases
+## so if configure does not exist in the git repo we need to
+## create it.
+if [ ! -f configure ]; then
+ ./otp_build autoconf
+ find . -name aclocal.m4 | xargs git add -f
+ find . -name configure | xargs git add -f
+ find . -name config.h.in | xargs git add -f
+ find . -name config.guess | xargs git add -f
+ find . -name config.sub | xargs git add -f
+ find . -name install-sh | xargs git add -f
+ if ! git config user.name; then
+ git config user.email "you@example.com"
+ git config user.name "Your Name"
+ fi
+ git commit --no-verify -m 'Add generated configure files'
+ AUTOCONF=1
+fi
+git archive --prefix otp/ -o "$TARGET" HEAD
+
+if [ "$AUTOCONF" = 1 ]; then
+ git reset --hard HEAD~1
+fi