forked from liuting1014/symphony-bdk-ui-toolkit-styles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·40 lines (35 loc) · 961 Bytes
/
publish.sh
File metadata and controls
executable file
·40 lines (35 loc) · 961 Bytes
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
#!/bin/bash
set -e
# Execute publish
function executePublish {
yarn pack
yarn publish --access public
git add package.json
git config --global user.email "$GIT_USEREMAIL"
git config --global user.name "$GIT_USERNAME"
git commit -m "[skip ci] AUTO Bump version"
git push origin HEAD:master
}
# Set version
function setVersion {
echo "Found tag, setting version to $CIRCLE_TAG"
yarn version --no-git-tag-version --new-version ${CIRCLE_TAG//v}
}
# Version and publish logic
function publish() {
echo "Running publish..."
setVersion;
executePublish;
postToUniversalWebhook;
echo "Publish End"
}
function postToUniversalWebhook() {
curl --location --request POST "$WEBHOOK_CONTRIBUTORS_URL" -F 'message=@webhook/publish-styles.xml' -F 'data={"version": { "styles": "'"$CIRCLE_TAG"'" }}'
}
# ====> Start
if [ -z "$CIRCLE_TAG" ]; then
echo "No tag, skip publish ..."
exit 0;
else
publish
fi