forked from greenaddress/WalletCrx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.sh
executable file
·47 lines (38 loc) · 1.17 KB
/
release.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -e
if [ "$(uname)" == "Darwin" ]; then
if ! which gsed; then
echo gsed missing
exit 1
fi
SED=gsed
else
SED=sed
fi
if [ $# -eq 0 ];
then
echo "Invalid or no arguments provided."
cat <<EOF
Usage: ./prepare.sh VERSION
Prepares a new Chrome app release.
positional arguments:
VERSION Version number to release
EOF
exit 1
fi
if [ ! -z "`git status -s | grep -v ^??`" ]; then ## ?? = untracked files
echo "You have uncommited changes. Please revert/stash them."
exit 1
fi
$SED -i 's/"version": "[0-9.]\+"/"version": "'$1'"/' manifest.json
$SED -i 's/"version": "[0-9.]\+"/"version": "'$1'"/' manifest_regtest.json
$SED -i 's/"version": "[0-9.]\+"/"version": "'$1'"/' manifest_liveregtest.json
$SED -i 's/"version": "[0-9.]\+"/"version": "'$1'"/' manifest_testnet.json
# _mainnet is optional:
$SED -i 's/"version": "[0-9.]\+"/"version": "'$1'"/' manifest_mainnet.json 2>/dev/null || true
git commit -S -am"bump version for release $1"
git tag -s -m"release $1" v$1
cd webfiles
git tag -s -m"release $1 for chrome" crx-v$1
cd ..
echo "Update and tagging done. Now please push this repo and webfiles/ with --tags."