-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.sh
executable file
·53 lines (40 loc) · 1.5 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
48
49
50
51
52
53
VERSION=$1
if [ "$1" == "" ]; then
echo "No argument provided. Tag number required."
exit 0
fi
nvm use 14
read -r -p "Are you sure you want to release ${VERSION}? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
git pull
echo "Releasing ${VERSION}..."
npm run build
# replace version in the snapcraft yaml
echo "Inject version ${VERSION} into snapcraft.yaml..."
sed -i "" -Ee "s/^version: .*/version: \"${VERSION}\"/" snap/snapcraft.yaml
# replace version in the package json
echo "Inject version ${VERSION} into package.json..."
sed -i "" -Ee "s/\s*\"version\": .*/\"version\": \"${VERSION}\",/" package.json
# replace version in the package json
echo "Inject version ${VERSION} into public index.html..."
sed -i "" -Ee "s/\s*<p>Version .*<\/p>/\<p>Version ${VERSION}<\/p>/" public/http/index.html
# replace version in the package json
echo "Inject version ${VERSION} into secure index.html..."
sed -i "" -Ee "s/\s*<p>Version .*<\/p>/\<p>Version ${VERSION}<\/p>/" public/https/index.html
echo "Adding remaining files to repo"
git add .
git commit -m "version bump and dist commit for release ${VERSION}"
echo "Tag and push"
git tag ${VERSION}
git push
git push --tags
echo "Running test... building packages (testing package.json)..."
yarn
echo "Running test... Launching hub execute"
node execute.js
;;
*)
exit 0
;;
esac