forked from web-push-libs/encrypted-content-encoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·30 lines (23 loc) · 782 Bytes
/
Copy pathrelease.sh
File metadata and controls
executable file
·30 lines (23 loc) · 782 Bytes
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
#!/usr/bin/env bash
set -e
root=$(cd $(dirname "$0"); pwd -P)
cd "$root"
sub='{ s/^.*["'"'"']\([0-9]*\.[0-9]*\.[0-9]*\)["'"'"'].*$/\1/;p; }'
old1=$(sed -n -e '/version *=/'"$sub"'' python/setup.py)
old2=$(sed -n -e '/"version" *:/'"$sub"'' nodejs/package.json)
if [ "$old1" != "$old2" ]; then
echo "Versions aren't the same: $old1 != $old2" 1>&2
exit 1
fi
IFS=. v=($old1)
new="${v[0]}.${v[1]}.$((${v[2]} + 1))"
sub='s/\(["'"'"']\)'"$old1"'["'"'"']/\1'"$new"'\1/'
sed -i~ -e '/version *=/'"$sub" python/setup.py
sed -i~ -e '/"version" *:/'"$sub" nodejs/package.json
cd "$root"/python
python setup.py sdist
twine upload dist/http_ece-"$new".tar.gz
cd "$root"/nodejs
npm publish
git commit -m "Update version to $new" python/setup.py nodejs/package.json
git tag v"$new"