|
1 | 1 | #!/usr/bin/env bash
|
2 | 2 |
|
| 3 | +set -e |
| 4 | + |
3 | 5 | if [[ "$#" -ne 1 ]]; then
|
4 |
| - VERSION_PARAMS=$(pnpm version --help | grep -oPm1 'npm version (.*)' | sed 's/npm version/''/g') |
5 |
| - echo "USAGE: $0 $VERSION_PARAMS" |
| 6 | + echo "Usage: $0 [--major|--minor|--patch]" |
6 | 7 | exit 1
|
7 | 8 | fi
|
8 | 9 |
|
9 |
| -cd raiden-ts |
10 |
| - |
11 |
| -PACKAGE_VERSION=$(cat package.json | |
12 |
| - grep version | |
13 |
| - head -1 | |
14 |
| - awk -F: '{ print $2 }' | |
15 |
| - sed 's/[",]//g' | |
16 |
| - tr -d '[[:space:]]') |
17 |
| - |
18 |
| -# Using `--no-git-tag-version` in January 2020 serves no purpose due to `npm version` |
19 |
| -# expecting the command to run from the same directory that also hosts the `.git` folder |
20 |
| -# You can find more information on https://github.com/npm/npm/issues/9111. |
21 |
| -# We disable the whole functionality because there no option exists to disable only automatic tagging. |
22 |
| -VERSION=$(pnpm version $1 --no-git-tag-version) |
23 |
| -echo "sdk version update updated to $VERSION" |
24 |
| -MESSAGE="v$PACKAGE_VERSION -> $VERSION" |
25 |
| - |
26 |
| -cd ../raiden-dapp/ |
27 |
| - |
28 |
| -DAPP_VERSION=$(pnpm version $1 --no-git-tag-version) |
29 |
| -echo "dApp version update updated to $DAPP_VERSION" |
30 |
| - |
31 |
| -cd ../raiden-cli/ |
| 10 | +cd "$( dirname $0 )" |
32 | 11 |
|
33 |
| -CLI_VERSION=$(pnpm version $1 --no-git-tag-version) |
34 |
| -echo "cli version update updated to $CLI_VERSION" |
| 12 | +OLD_VERSION=`yarn versions --json | jq -er '.data."light-client"'` |
| 13 | +yarn version $1 --no-git-tag-version |
| 14 | +NEW_VERSION=`yarn versions --json | jq -er '.data."light-client"'` |
| 15 | +MESSAGE="v$OLD_VERSION -> $NEW_VERSION" |
35 | 16 |
|
36 |
| -cd ../ |
37 |
| -ROOT_VERSION=$(pnpm version $1 --no-git-tag-version) |
38 |
| -echo "light client version update updated to $ROOT_VERSION" |
| 17 | +yarn workspace raiden-ts version --no-git-tag-version --new-version "${NEW_VERSION}" |
| 18 | +yarn workspace raiden-dapp version --no-git-tag-version --new-version "${NEW_VERSION}" |
| 19 | +yarn workspace raiden-cli version --no-git-tag-version --new-version "${NEW_VERSION}" |
39 | 20 |
|
40 |
| -pnpm install |
| 21 | +yarn install |
41 | 22 |
|
42 |
| -git add package.json |
43 |
| -git add raiden-ts/package.json |
44 |
| -git add raiden-dapp/package.json |
45 |
| -git add raiden-cli/package.json |
46 |
| -git add pnpm-lock.yaml |
| 23 | +git add package.json raiden-{ts,dapp,cli}/package.json yarn.lock |
47 | 24 |
|
48 | 25 | echo "Preparing to commit version update $MESSAGE"
|
49 | 26 | git commit -m "$MESSAGE"
|
0 commit comments