|
1 | 1 | #!/bin/bash
|
2 | 2 | #
|
3 | 3 | # Script to perform a release of matrix-react-sdk.
|
4 |
| -# |
5 |
| -# Requires githib-changelog-generator; to install, do |
6 |
| -# pip install git+https://github.com/matrix-org/github-changelog-generator.git |
7 | 4 |
|
8 | 5 | set -e
|
9 | 6 |
|
10 |
| -cd `dirname $0` |
| 7 | +cd "$(dirname "$0")" |
11 | 8 |
|
12 | 9 | # This link seems to get eaten by the release process, so ensure it exists.
|
13 | 10 | yarn link matrix-js-sdk
|
14 | 11 |
|
15 |
| -for i in matrix-js-sdk |
16 |
| -do |
17 |
| - echo "Checking version of $i..." |
18 |
| - depver=`cat package.json | jq -r .dependencies[\"$i\"]` |
19 |
| - latestver=`yarn info -s $i dist-tags.next` |
20 |
| - if [ "$depver" != "$latestver" ] |
21 |
| - then |
22 |
| - echo "The latest version of $i is $latestver but package.json depends on $depver." |
23 |
| - echo -n "Type 'u' to auto-upgrade, 'c' to continue anyway, or 'a' to abort:" |
24 |
| - read resp |
25 |
| - if [ "$resp" != "u" ] && [ "$resp" != "c" ] |
26 |
| - then |
27 |
| - echo "Aborting." |
28 |
| - exit 1 |
29 |
| - fi |
30 |
| - if [ "$resp" == "u" ] |
31 |
| - then |
32 |
| - echo "Upgrading $i to $latestver..." |
33 |
| - yarn add -E $i@$latestver |
34 |
| - git add -u |
35 |
| - git commit -m "Upgrade $i to $latestver" |
36 |
| - fi |
37 |
| - fi |
38 |
| -done |
39 |
| - |
40 | 12 | ./node_modules/matrix-js-sdk/release.sh "$@"
|
41 |
| - |
42 |
| -release="${1#v}" |
43 |
| -prerelease=0 |
44 |
| -# We check if this build is a prerelease by looking to |
45 |
| -# see if the version has a hyphen in it. Crude, |
46 |
| -# but semver doesn't support postreleases so anything |
47 |
| -# with a hyphen is a prerelease. |
48 |
| -echo $release | grep -q '-' && prerelease=1 |
49 |
| - |
50 |
| -if [ $prerelease -eq 0 ] |
51 |
| -then |
52 |
| - # For a release, reset SDK deps back to the `develop` branch. |
53 |
| - for i in matrix-js-sdk |
54 |
| - do |
55 |
| - echo "Resetting $i to develop branch..." |
56 |
| - yarn add github:matrix-org/$i#develop |
57 |
| - git add -u |
58 |
| - git commit -m "Reset $i back to develop branch" |
59 |
| - done |
60 |
| - git push origin develop |
61 |
| -fi |
0 commit comments