-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpush.sh
executable file
·63 lines (48 loc) · 1.42 KB
/
push.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
59
60
61
62
63
#!/bin/zsh
# Authoer: Rakuyo
# Update Date: 2022.04.02
project_path=$(cd `dirname $0` ; pwd)
cd $project_path
while read line
do
if [[ $line =~ "s.name" ]] ; then
name=`echo $line | cut -d = -f 2 | cut -d \' -f 2`
fi
if [[ $line =~ "s.version" ]] ; then
version=`echo $line | cut -d = -f 2 | cut -d \' -f 2`
break
fi
done < $(find ./ -name '*.podspec')
lintLib(){
pod lib lint $name.podspec --allow-warnings --skip-tests
}
release(){
release_branch=release/$version
git checkout -b $release_branch develop
agvtool new-marketing-version $version
agvtool next-version -all
build=$(agvtool what-version | tail -n2 | awk -F ' ' '{print $NF}')
git_message="[Release] version: $version build: $build"
git add . && git commit -m "$git_message"
git checkout master
git merge --no-ff -m 'Merge branch '$release_branch'' $release_branch
git push origin master
git tag $version
git push origin $version
git checkout develop
git merge --no-ff -m 'Merge tag '$version' into develop' $version
git push origin develop
git branch -d $release_branch
pod trunk push $name.podspec --allow-warnings --skip-tests
}
echo "Whether to skip local verification? [Y/N]?"
if read -t 5 is_skip_lint; then
case $is_skip_lint in
(N | n)
lintLib && release;;
(*)
release;;
esac
else
release
fi