-
Notifications
You must be signed in to change notification settings - Fork 1
/
bump.sh
executable file
·32 lines (32 loc) · 886 Bytes
/
bump.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
#!/usr/local/bin/bash
if [[ $2 == 'npm' ]]
then
if [[ $(git tag -l v$1-b) ]]
then
git checkout browser bundle/bundle.min.js extensions/dist/*.js extensions/*.css
gsed -i 's|/gh/bhsd-harry/wikiparser-node@${version}-b|/npm/wikiparser-node@${version}|' extensions/dist/base.js
gsed -i -E "s/\"version\": \".+\"/\"version\": \"$1\"/" package.json
npm i --package-lock-only
npm publish --tag ${3-latest}
if [[ -z $3 ]]
then
npm dist-tag add wikiparser-node@$1 browser
fi
rm bundle/bundle.min.js extensions/dist/*.js extensions/*.css
git add -A
git commit -m "chore: publish v$1 to npm"
else
echo "Tag v$1-b not found"
exit 1
fi
else
npm run lint && npm run build && npm test && npm run test:parser && npm run test:real
if [[ $? -eq 0 ]]
then
git add -A
git commit -m "chore: bump version to v$1"
git push
git tag v$1
git push origin v$1
fi
fi