forked from doric-pub/Doric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.sh
58 lines (41 loc) · 1.54 KB
/
publish.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
54
55
56
57
58
#!/usr/bin/env bash
##############################################################################
##
## Publish JS,Android,iOS,Web
##
##############################################################################
CURRENT_DIR=$(cd $(dirname $0); pwd)
CURRENT_VERSION=$(cat $CURRENT_DIR/version)
echo "Current version is "$CURRENT_VERSION
cd $CURRENT_DIR && sh bundle.sh
# Modify
## JS
cd $CURRENT_DIR/doric-js && npm version $CURRENT_VERSION --allow-same-version
## Android
echo "version="$CURRENT_VERSION > $CURRENT_DIR/doric-android/version.properties
## iOS
sed -i "" "s/\(version[ ]*= \)'[0-9 \.]*'/\1'$CURRENT_VERSION'/g" $CURRENT_DIR/DoricCore.podspec
sed -i "" "s/\(version[ ]*= \)'[0-9 \.]*'/\1'$CURRENT_VERSION'/g" $CURRENT_DIR/DoricDevkit.podspec
## Web
cd $CURRENT_DIR/doric-web && npm version $CURRENT_VERSION --allow-same-version
## CLI
echo $CURRENT_VERSION > $CURRENT_DIR/doric-cli/assets/version
cd $CURRENT_DIR/doric-cli && npm version $CURRENT_VERSION --allow-same-version
# git save
cd $CURRENT_DIR/
echo "Commit changes"
git add .
git commit -m "Release v${CURRENT_VERSION}"
git tag ${CURRENT_VERSION}
git push
git push --tags
echo "Publish CLI"
cd $CURRENT_DIR/doric-cli && npm publish
echo "Publish JS"
cd $CURRENT_DIR/doric-js && npm publish
echo "Publish Web"
cd $CURRENT_DIR/doric-web && npm publish
echo "Publish Android"
cd $CURRENT_DIR/doric-android && ./gradlew clean publishAll
echo "Publish iOS"
cd $CURRENT_DIR && pod trunk push DoricCore.podspec --allow-warnings && pod trunk push DoricDevkit.podspec --allow-warnings