Skip to content

Commit 91ad900

Browse files
authored
Merge pull request matrix-org#4076 from matrix-org/jryans/release-tag-tweaks
Automate SDK dep upgrades for release
2 parents ab91e85 + 1938dc4 commit 91ad900

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

release.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,51 @@ set -e
99

1010
cd `dirname $0`
1111

12+
for i in matrix-js-sdk
13+
do
14+
depver=`cat package.json | jq -r .dependencies[\"$i\"]`
15+
latestver=`yarn info -s $i dist-tags.next`
16+
if [ "$depver" != "$latestver" ]
17+
then
18+
echo "The latest version of $i is $latestver but package.json depends on $depver."
19+
echo -n "Type 'u' to auto-upgrade, 'c' to continue anyway, or 'a' to abort:"
20+
read resp
21+
if [ "$resp" != "u" ] && [ "$resp" != "c" ]
22+
then
23+
echo "Aborting."
24+
exit 1
25+
fi
26+
if [ "$resp" == "u" ]
27+
then
28+
echo "Upgrading $i to $latestver..."
29+
yarn add -E $i@$latestver
30+
git add -u
31+
# The `-e` flag opens the editor and gives you a chance to check
32+
# the upgrade for correctness.
33+
git commit -m "Upgrade $i to $latestver" -e
34+
fi
35+
fi
36+
done
37+
1238
exec ./node_modules/matrix-js-sdk/release.sh -z "$@"
39+
40+
release="${1#v}"
41+
prerelease=0
42+
# We check if this build is a prerelease by looking to
43+
# see if the version has a hyphen in it. Crude,
44+
# but semver doesn't support postreleases so anything
45+
# with a hyphen is a prerelease.
46+
echo $release | grep -q '-' && prerelease=1
47+
48+
if [ $prerelease -eq 0 ]
49+
then
50+
# For a release, reset SDK deps back to the `develop` branch.
51+
for i in matrix-js-sdk
52+
do
53+
echo "Resetting $i to develop branch..."
54+
yarn add github:matrix-org/$i#develop
55+
git add -u
56+
git commit -m "Reset $i back to develop branch"
57+
done
58+
git push origin develop
59+
fi

0 commit comments

Comments
 (0)