-
Notifications
You must be signed in to change notification settings - Fork 3
170 lines (144 loc) · 5.65 KB
/
make-profiles.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Make Profiles
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'With TMATE'
required: false
default: false
schedule:
- cron: '0 0 * * 5'
push:
branches: [ "*" ]
env:
manjaroProfiles: manjaro-iso-profiles
makeisoprofilesdir: biglinux-make-iso-profiles
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Tmate ##
- name: Setup TMATE Session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Clone ManjaroIsoProfile
shell: bash
run: |
# clone or Update git
if [ ! -d "$manjaroProfiles" ]; then
git clone https://gitlab.manjaro.org/profiles-and-settings/iso-profiles.git $manjaroProfiles
else
pushd $manjaroProfiles
git pull
popd
fi
- name: Make Base
shell: bash
run: |
# Copy files
cp $makeisoprofilesdir/base/profile.conf shared/
cp $makeisoprofilesdir/base/pacman-default.conf shared/
cp $makeisoprofilesdir/base/user-repos.conf shared/
#Copy dirs
cp -r $makeisoprofilesdir/base/desktop-overlay/ shared/
cp -r $makeisoprofilesdir/base/root-overlay/ shared/
cp -r $makeisoprofilesdir/base/live-overlay/ shared/
# Remove Mhwd
if [ -e "$makeisoprofilesdir/base/Mhwd-remove" ]; then
grep -v -f $makeisoprofilesdir/base/Mhwd-remove $manjaroProfiles/shared/Packages-Mhwd > shared/Packages-Mhwd
else
echo "ERROR Remove Mhwd"
exit 1
fi
# Remove Root
if [ -e "$makeisoprofilesdir/base/Root-remove" ]; then
grep -v -f $makeisoprofilesdir/base/Root-remove $manjaroProfiles/shared/Packages-Root > shared/Packages-Root
else
echo "ERROR Remove Root"
exit 1
fi
# Remove Live
if [ -e "$makeisoprofilesdir/base/Live-remove" ]; then
grep -v -f $makeisoprofilesdir/base/Live-remove $manjaroProfiles/shared/Packages-Live > shared/Packages-Live
else
echo "ERROR Remove Live"
exit 1
fi
# Add Mhwd
if [ -e "$makeisoprofilesdir/base/Mhwd-add" ]; then
cat $makeisoprofilesdir/base/Mhwd-add >> shared/Packages-Mhwd
else
echo "ERROR Add Mhwd"
exit 1
fi
# Add Root
if [ -e "$makeisoprofilesdir/base/Root-add" ]; then
cat $makeisoprofilesdir/base/Root-add >> shared/Packages-Root
else
echo "ERROR Add Root"
exit 1
fi
# Add Live
if [ -e "$makeisoprofilesdir/base/Live-add" ]; then
# echo '' >> $manjaroProfiles/community/biglinux/Packages-Live
cat $makeisoprofilesdir/base/Live-add >> shared/Packages-Live
else
echo "ERROR Add Live"
exit 1
fi
- name: Make Flavours
shell: bash
run: |
## make FLAVOURS ##
# for i in $(ls -d */ | cut -f1 -d'/' | sed '/base/d'); do
for i in $(ls $makeisoprofilesdir | sed '/base/d;/big-small/d'); do
echo ""
echo "MAKE $i"
echo ""
rsync -Cravzp --delete shared/ biglinux/$i
# # Remove Desktop
# if [ -e "$makeisoprofilesdir/$i/Desktop-remove" ]; then
# grep -v -f $makeisoprofilesdir/$i/Desktop-remove $manjaroProfiles/shared/Packages-Desktop > biglinux/$i/Packages-Desktop
# else
# echo "ERROR Remove Desktop $i"
# exit 1
# fi
# Add Desktop
if [ -e "$makeisoprofilesdir/$i/Desktop-add" ]; then
cat $makeisoprofilesdir/$i/Desktop-add > biglinux/$i/Packages-Desktop
else
echo "ERROR Add Desktop $i"
exit 1
fi
# Remove Root
if [ -e "$makeisoprofilesdir/$i/Root-remove" ]; then
grep -v -f $makeisoprofilesdir/$i/Root-remove shared/Packages-Root > biglinux/$i/Packages-Root
else
echo "no Remove Root in $i"
fi
# Add Live
if [ -e "$makeisoprofilesdir/$i/Live-add" ]; then
cat $makeisoprofilesdir/$i/Live-add >> biglinux/$i/Packages-Live
else
echo "no Add Live"
fi
#run special commands
if [ -e "$makeisoprofilesdir/$i/special-commands.sh" ]; then
bash -x $makeisoprofilesdir/$i/special-commands.sh
fi
done
#remove manjaro profiles
rm -rf $manjaroProfiles
- name: Update github
run: |
git add --all
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [ -n "$(git commit -m "new profile" -a | grep "nothing to commit")" ];then exit 0; fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}