Skip to content

Commit a79fc0c

Browse files
committed
misc: add release script
1 parent 0f0adc8 commit a79fc0c

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

release.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Don't start a release if the tree is dirty
6+
#
7+
8+
if [[ ! -z $(git status -s) ]]; then
9+
echo "Git tree is not clean, aborting release!"
10+
exit 1
11+
fi
12+
13+
# Get version and branch (we only do stable for now)
14+
#
15+
16+
V="$1"
17+
RELEASE="${2:-stable}"
18+
19+
if [[ -z $V ]]; then
20+
echo "A version must be specified!"
21+
exit 1
22+
fi
23+
24+
VERSION="${RELEASE}-${V}"
25+
echo "Releasing ${VERSION}"
26+
27+
if git rev-parse "${VERSION}" >/dev/null 2>&1; then
28+
echo "Tag for such version already exists!"
29+
exit 1
30+
fi
31+
32+
# Prepare changelog
33+
#
34+
35+
LAST_VERSION=$(git describe --tags --abbrev=0)
36+
CHANGES=$(git log --oneline --no-decorate --no-merges ${LAST_VERSION}..HEAD --pretty=format:"%x2a%x20%h%x20%s")
37+
38+
echo "Changelog:"
39+
echo "$CHANGES"
40+
41+
echo -e "## ${VERSION}\n\nBased on ${RELEASE} release ${V}.\n\n${CHANGES}\n" > tmp
42+
cat CHANGELOG.md >> tmp
43+
mv tmp CHANGELOG.md
44+
45+
# Set specific image tags in compose files
46+
#
47+
48+
sed -i "" -e "s/latest/${VERSION}/" *.yml
49+
50+
# Commit all changes and tag the repo
51+
#
52+
53+
git commit -a -m "release: ${VERSION}" -m "${CHANGES}"
54+
git tag -a "${VERSION}" -m "${CHANGES}"
55+
56+
# Tag Docker images and push them to DockerHub
57+
#
58+
59+
JITSI_BUILD=${VERSION} make release
60+
61+
# Revert back to "latest" for development
62+
#
63+
64+
sed -i "" -e "s/${VERSION}/latest/" *.yml
65+
66+
git commit -a -m "misc: working on latest"
67+
68+
# Push all changes and tags
69+
#
70+
71+
git push
72+
git push --tags

0 commit comments

Comments
 (0)