-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlocal-publish.sh
41 lines (33 loc) · 1.28 KB
/
local-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
#!/bin/sh
set -o pipefail
set -e
remote_url="git@gitee.com:aliyun-sls/opentelemetry-objc-extension.git"
VERSION=$(cat VERSION)
echo "version: ${VERSION}"
sed -i '' "s/s.version *=.*/s.version = \"$VERSION\"/" OpenTelemetryApiObjc.podspec
sed -i '' "s/s.version *=.*/s.version = \"$VERSION\"/" OpenTelemetrySdkObjc.podspec
git add VERSION
git add OpenTelemetryApiObjc.podspec
git add OpenTelemetrySdkObjc.podspec
if [ -n "$(git diff --cached --name-only)" ]; then
echo "Has staged changes"
git commit -m "version: $VERSION"
else
echo "No git changes"
fi
if git rev-parse -q --verify "refs/tags/$VERSION" >/dev/null; then
git tag -d $VERSION
echo "Local tag: $VERSION has deleted"
else
echo "No local git tag: $VERSION"
fi
if git ls-remote --tags "$remote_url" | grep -qE "refs/tags/$VERSION$"; then
git push gitee :$VERSION
echo "Remote tag: $VERSION has deleted"
else
echo "No remote git tag: $VERSION"
fi
git tag $VERSION
git push gitee $VERSION
pod repo push gitee-aliyun-sls OpenTelemetryApiObjc.podspec --allow-warnings --verbose --skip-tests --sources=https://gitee.com/aliyun-sls/Specs.git
pod repo push gitee-aliyun-sls OpenTelemetrySdkObjc.podspec --allow-warnings --verbose --skip-tests --sources=https://gitee.com/aliyun-sls/Specs.git