forked from ococl/ant-design-blazor
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 2.66 KB
/
icon-sync.yaml
File metadata and controls
53 lines (51 loc) · 2.66 KB
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
name: Synchronization Icons
on:
schedule:
- cron: "0 0 1 * *"
jobs:
icon-sync:
runs-on: ubuntu-latest
steps:
- name: Sync icons from ant-design-icons
shell: bash
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
ANT_DESIGN_SOURCE_PATH: ./packages/icons-svg/svg/.
ANT_DESIGN_BLAZOR_DESTINATION_PATH: ../ant-design-blazor/source/Append.AntDesign/wwwroot/icons
run: |
git clone https://github.com/ant-design/ant-design-icons.git
git clone https://github.com/Append-IT/ant-design-blazor.git
cd ant-design-icons
LAST_VERSION=$(git describe --abbrev=0 --tags | sed 's/* //' )
echo "Last Version of ant-design-icons: ${LAST_VERSION}"
git checkout ${LAST_VERSION}
cd ../ant-design-blazor
BRANCH_NAME="sync-icons/${LAST_VERSION}"
if [ $( git branch -a | egrep "remotes/origin/${BRANCH_NAME}" | wc -l) -gt 0 ]; then
echo "Branch ${BRANCH_NAME} already exists."
exit 0
fi
echo "Creating a new branch ${BRANCH_NAME} ..."
git checkout -b ${BRANCH_NAME}
cd ../ant-design-icons
echo "Synchronizing the SVG icon files to ant-design-blazor..."
echo "Source : ${ANT_DESIGN_SOURCE_PATH}"
echo "Destination: ${ANT_DESIGN_BLAZOR_DESTINATION_PATH}"
rsync -av ${ANT_DESIGN_SOURCE_PATH} ${ANT_DESIGN_BLAZOR_DESTINATION_PATH}
cd ${ANT_DESIGN_BLAZOR_DESTINATION_PATH}
TOTAL_MODIFIED=$(git status -s | wc -l)
if [ "$TOTAL_MODIFIED" -eq "0" ]; then
echo "nothing modified"
exit 0
fi
echo "Total modified: ${TOTAL_MODIFIED}"
git config --global user.name 'vertonghenb'
git config --global user.email 'benjamin.vertonghen@append.be'
git add -A
git commit -m "[BOT] Sync Icons from ant-design-icons v${LAST_VERSION}"
git push https://Append-IT:$GITHUB_TOKEN@github.com/Append-IT/ant-design-blazor.git ${BRANCH_NAME}
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
cat>PR<<EOF
[BOT] Sync Icons from ant-design-icons v${LAST_VERSION}
EOF
bin/hub pull-request -F PR -b Append-IT:master -h Append-IT:${BRANCH_NAME} -a Append-IT