forked from purescript/package-sets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·52 lines (36 loc) · 1.22 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
set -euo pipefail
# Please use this script to cut new releases. It will generate a new tag name
# based on the current date, update the latest releases file, and push the tag
# Fail if we are not on trunk
BRANCH=$(git branch --show-current)
if [ "${BRANCH}" != "master" ]; then
echo "Please checkout master branch";
exit 1;
fi
git pull
LATEST_PURS="0.14.7"
NEW_STABLE_TAG="psc-${LATEST_PURS}"
# Create the first tag for the compiler if it doesn't exist
if git rev-parse "${NEW_STABLE_TAG}" >/dev/null 2>&1; then
echo "Stable tag '${NEW_STABLE_TAG}' already exists, skipping";
else
echo "Creating and pushing new tag '${NEW_STABLE_TAG}'.."
git tag "${NEW_STABLE_TAG}";
git push origin "${NEW_STABLE_TAG}";
fi
NEW_TAG="psc-${LATEST_PURS}-`date +'%Y%m%d'`"
# Fail if the new tag already exists
# Note: exit status of the command is the conditional
if git rev-parse "${NEW_TAG}" >/dev/null 2>&1; then
echo "Tag '${NEW_TAG}' already exists!";
exit 1;
fi
echo "Creating and pushing new tag '${NEW_TAG}'.."
./update-latest-compatible-sets.sh "${NEW_TAG}"
git add latest-compatible-sets.json
git commit -m "Update to the latest tag"
git push
git tag "${NEW_TAG}"
git push origin "${NEW_TAG}"
echo "Done."