-
Notifications
You must be signed in to change notification settings - Fork 10
/
build
68 lines (66 loc) · 2.17 KB
/
build
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
64
65
66
67
68
#! /bin/bash
if [ ! -z "$1" ];then
TAGS="$1"
else
TAGS=""
fi
if [ "$TAGS" == "neutron" ] || [ "$TAGS" == "trb" ] || [ "$2" == "archlinux" ];then
YAML="archlinux.yml"
else
YAML="ubjammy.yml"
fi
function update_file() {
if [ ! -z "$1" ] && [ ! -z "$2" ] && [ ! -z "$3" ];then
GetValue="$(cat "$3" | grep "$1")"
GetPath=${3/"./"/"/"}
[ "$GetValue" != "$2" ] && \
sed -i "s/$1.*/$2/g" "$3"
[ ! -z "$(git status | grep "modified" )" ] && \
git add "$3" && \
git commit -m "update builder $2"
fi
}
function update_fileB() {
if [ ! -z "$1" ] && [ ! -z "$2" ] && [ ! -z "$3" ];then
GetValue="$(cat "$3" | grep "$1")"
GetPath=${3/"./"/"/"}
[ "$GetValue" != "$2" ] && \
sed -i "s/$1.*/$2"'"'"/g" "$3"
[ ! -z "$(git status | grep "modified" )" ] && \
git add "$3" && \
git commit -m "update builder $2"
fi
}
function make_changes() {
git checkout master && git checkout -b $1-$2
git checkout $1-$2
mkdir -p .github/workflows
cp -af GHYML/$YAML .github/workflows/build.yml
git add .
update_fileB "00000" "$2" "./$1.sh" && update_file 'do-main.sh' "$1.sh" './.circleci/config.yml'
}
ListBranch=""
for Files in do-main
do
if [ "$TAGS" == "all" ];then
if [[ -e ${Files}.sh ]];then
for Types in proton dtc gcc gcc12 storm strix sdclang atom zyc neutron trb
do
git branch -D $Files-$Types
make_changes $Files $Types
ListBranch="$ListBranch $Files-$Types"
git checkout master
done
fi
else
if [[ -e ${Files}.sh ]];then
if [ "$TAGS" == "gcc" ] || [ "$TAGS" == "gcc12" ] || [ "$TAGS" == "proton" ] || [ "$TAGS" == "dtc" ] || [ "$TAGS" == "storm" ] || [ "$TAGS" == "strix" ] || [ "$TAGS" == "sdclang" ] || [ "$TAGS" == "atom" ] || [ "$TAGS" == "zyc" ] || [ "$TAGS" == "neutron" ] || [ "$TAGS" == "trb" ];then
git branch -D $Files-$TAGS
make_changes $Files $TAGS
ListBranch="$ListBranch $Files-$TAGS"
git checkout master
fi
fi
fi
done
git push -f origin $ListBranch