summaryrefslogtreecommitdiff
path: root/scripts/bundle-otp
diff options
context:
space:
mode:
authorLukas Larsson <lukas@erlang.org>2020-09-18 14:59:12 +0200
committerLukas Larsson <lukas@erlang.org>2020-09-24 08:49:55 +0200
commitadc535566e795d35f9d526cb837270afab1a7452 (patch)
tree02d0e9c6d74075a5641914f59e55dbe88c915299 /scripts/bundle-otp
parentdb6059a9217767a6e42e93cec05089c0ec977d20 (diff)
downloaderlang-adc535566e795d35f9d526cb837270afab1a7452.tar.gz
Add github actions
Diffstat (limited to 'scripts/bundle-otp')
-rwxr-xr-xscripts/bundle-otp44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/bundle-otp b/scripts/bundle-otp
new file mode 100755
index 0000000000..ce5bc47572
--- /dev/null
+++ b/scripts/bundle-otp
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+set -e
+
+GIT_TAG="$1"
+ERL_TOP=${ERL_TOP:-$PWD}
+
+OTP_META_FILE=$ERL_TOP/artifacts/${GIT_TAG}.0-bundle.txt
+OTP_FILE=$ERL_TOP/artifacts/${GIT_TAG}.0-bundle.tar.gz
+
+REPOSITORIES="otp,$GIT_TAG corba,.*"
+
+if [ ! -d $ERL_TOP/artifacts ]; then
+ mkdir $ERL_TOP/artifacts
+fi
+
+mkdir bundle
+
+## Turn off * expansion, needed for the .* regexp to work
+set -f
+
+for repo in $REPOSITORIES; do
+ OLD_IFS=$IFS
+ IFS=','
+ set -- $repo
+ IFS=$OLD_IFS
+ cd $ERL_TOP/bundle/
+ git clone https://github.com/erlang/$1 $1
+ cd $1
+ echo $1 $2
+ TAG=`git tag -l | grep -P "^$2$" | sort -V | tail -1`
+ git checkout $TAG
+ SHA=`git rev-parse --verify HEAD`
+ rm -rf .git
+ echo "$1 $TAG $SHA" >> $OTP_META_FILE
+done
+
+## Turn on * expansion
+set +f
+
+cd $ERL_TOP/bundle/
+tar czf $OTP_FILE *
+
+exit 0