-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction-old-old.yml
753 lines (656 loc) · 33.8 KB
/
action-old-old.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
name: 'BigLinux Iso Action'
description: 'Installs prerequisites for building Manjaro on ubuntu'
inputs:
iso-profiles-repo:
description: 'iso profiles to clone'
required: false
default: 'https://github.com/biglinux/iso-profiles'
# iso-profiles-branch:
# description: 'branch of the iso profiles to check out'
# required: false
edition:
description: 'name of the iso profile to build'
required: true
manjarobranch:
description: 'stable (default), testing, unstable'
required: false
default: stable
bigbranch:
description: 'stable, beta, development'
required: true
scope:
description: 'full (default) or minimal image'
required: false
default: full
# version:
# description: 'dist_release version (upstream if not given)'
# required: false
kernel:
description: 'kernel version'
required: false
default: 515
# code-name:
# description: 'manjaro code-name (upstream if not given)'
# required: false
release-tag:
description: 'release tag to upload to (if set)'
required: false
# custom-repo:
# description: 'name a custom repo to be prioritized above the default ones'
# required: false
# office-chooser:
# description: 'include calamares office installer module'
# required: false
# default: "false"
build-mirror:
description: 'specific build mirror to use'
required: false
default: https://forksystems.mm.fcix.net/manjaro
# gpg-secret-key-base64:
# description: 'base64 encoded gpg secret key (without a passphrase) to sign the zip (if set)'
# required: false
# gpg-passphrase:
# description: 'phrase to decrypt the gpg secret key if given'
# required: false
# additional-trusted-gpg:
# description: 'gpg keyids that pacman should trust'
# required: false
# cdn77-host:
# description: 'cdn77 upload credentials'
# required: false
# cdn77-user:
# description: 'cdn77 upload credentials'
# required: false
# cdn77-pwd:
# description: 'cdn77 upload credentials'
# required: false
# sf-project:
# description: 'sf upload credentials'
# required: false
# sf-user:
# description: 'sf upload credentials'
# required: false
# sf-key:
# description: 'sf upload credentials'
# required: false
# osdn-project:
# description: 'osdn upload credentials'
# required: false
# osdn-user:
# description: 'osdn upload credentials'
# required: false
# osdn-key:
# description: 'osdn upload credentials'
# required: false
mesa:
description: 'alternative mesa'
required: false
# extrarepo:
# description: 'extra repository to buld package'
# required: false
outputs:
file-path:
description: "path of the generated iso"
value: ${{ steps.image-build.outputs.file-path }}
runs:
using: "composite"
steps:
# # Tmate ##
# - name: Setup TMATE Session
# uses: mxschmitt/action-tmate@v3
- id: install-build-dependencies
shell: bash
run: |
echo "### install-build-dependencies ###"
# echo "deb http://ppa.launchpad.net/apt-fast/stable/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/apt-fast.list
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A2166B8DE8BDC3367D1901C11EE2FF37CA8DA16B
sudo apt update
# sudo apt dist-upgrade
# sudo apt install \
# sudo apt-fast dist-upgrade -y
sudo apt-fast install -y \
gdisk \
zip \
systemd-container \
bmap-tools \
asciidoc \
libarchive-tools \
git \
build-essential \
cmake \
libarchive-dev \
pkg-config \
libcurl4-openssl-dev \
libgpgme-dev \
libssl-dev \
fakeroot \
dh-autoreconf \
haveged \
os-prober \
kwalify \
dosfstools \
libisoburn1 \
squashfs-tools \
docbook2x \
mktorrent \
doxygen \
zstd
sudo python3 -m pip install meson
sudo python3 -m pip install ninja
- id: no-fsync
shell: bash
run: |
sudo wget https://raw.githubusercontent.com/biglinux/disable-fsync/main/disable-fsync/usr/lib/disable-fsync.so -O /usr/lib/disable-fsync.so
echo "/usr/lib/disable-fsync.so" | sudo tee -a /etc/ld.so.preload
sudo ldconfig
- id: install-pacman
shell: bash
env:
#PACMAN_VERSION: 6.0.1
PACMAN_VERSION: 6.0.2
run: |
echo "### install-pacman ###"
sudo git clone --depth 1 https://gitlab.manjaro.org/packages/core/pacman.git
pushd pacman
sudo wget https://sources.archlinux.org/other/pacman/pacman-${PACMAN_VERSION}.tar.xz
sudo tar -xvf pacman-${PACMAN_VERSION}.tar.xz
pushd pacman-${PACMAN_VERSION}
sudo patch -p1 -i ../pacman-sync-first-option.patch
sudo meson --prefix=/usr \
--buildtype=plain \
-Ddoc=disabled \
-Ddoxygen=enabled \
-Dscriptlet-shell=/usr/bin/bash \
-Dldconfig=/usr/bin/ldconfig \
build
sudo meson compile -C build
sudo meson install -C build
popd
sudo install -m644 pacman.conf /etc/pacman.conf
sudo install -m644 makepkg.conf /etc/
sudo mkdir -p /etc/pacman.d
# sudo touch /etc/pacman.d/mirrorlist
# echo 'Server = ${{ inputs.build-mirror }}/stable/$repo/$arch' | sudo tee -a /etc/pacman.d/mirrorlist
sudo wget https://raw.githubusercontent.com/BigLinux-Package-Build/manjaro-mirror/main/mirrorlist -O /etc/pacman.d/mirrorlist
# sudo sed -i '/\[core\]/{h;s/.*/\[biglinux-update-stable\]/;p;x;}' /etc/pacman.conf
# sudo sed -i '/\[core\]/{h;s/.*/SigLevel = PackageRequired/;p;x;}' /etc/pacman.conf
# sudo sed -i '/\[core\]/{h;s/.*/Server = https:\/\/repo.biglinux.com.br\/update-stable\/$arch/;p;x;}' /etc/pacman.conf
# sudo sed -i '/\[core\]/{h;s/.*//;p;x;}' /etc/pacman.conf
popd
sudo rm -r pacman
- id: install-keyrings
shell: bash
run: |
echo "### install-keyrings ###"
sudo install -dm755 /usr/share/pacman/keyrings/
sudo git clone --depth 1 https://gitlab.manjaro.org/packages/core/manjaro-keyring.git
pushd manjaro-keyring
sudo install -m0644 manjaro.gpg /usr/share/pacman/keyrings/
sudo install -m0644 manjaro-trusted /usr/share/pacman/keyrings/
sudo install -m0644 manjaro-revoked /usr/share/pacman/keyrings/
popd
sudo rm -r manjaro-keyring
sudo git clone --depth 1 https://github.com/biglinux/biglinux-keyring.git
pushd biglinux-keyring
sudo install -m0644 biglinux.gpg /usr/share/pacman/keyrings/
sudo install -m0644 biglinux-trusted /usr/share/pacman/keyrings/
sudo install -m0644 biglinux-trusted /usr/share/pacman/keyrings/
popd
sudo rm -r biglinux-keyring
mkdir -p archlinux-keyring
pushd archlinux-keyring
wget https://archlinux.org/packages/core/any/archlinux-keyring/download -O /tmp/archlinux-keyring.tar.zst
tar --use-compress-program=unzstd --strip-components=4 --wildcards -xvf /tmp/archlinux-keyring.tar.zst usr/share/pacman/keyrings/*
sudo install -m0644 archlinux.gpg /usr/share/pacman/keyrings/
sudo install -m0644 archlinux-trusted /usr/share/pacman/keyrings/
sudo install -m0644 archlinux-revoked /usr/share/pacman/keyrings/
popd
sudo rm -r archlinux-keyring
#sudo pacman-key --init
#sudo pacman-key --populate archlinux manjaro biglinux
# for gpg_key in ${{ inputs.additional-trusted-gpg }}; do
# sudo pacman-key --keyserver keys.openpgp.org --recv-key $gpg_key
# done
- id: pull-keys
shell: bash
run: |
echo "### pull-keys ###"
sudo git clone https://github.com/biglinux/biglinux-key.git
sudo install -dm755 /etc/pacman.d/gnupg/
sudo install -m0644 biglinux-key/usr/share/pacman/keyrings/* /etc/pacman.d/gnupg/
sudo rm -r biglinux-key
sudo pacman -Sy
- id: install-arch-install-scripts
shell: bash
env:
#VERSION: "24"
VERSION: "27"
run: |
echo "### install-arch-install-scripts ###"
sudo wget https://github.com/archlinux/arch-install-scripts/archive/refs/tags/v${VERSION}.tar.gz -O arch-install-scripts.tar.gz
sudo tar -xvf arch-install-scripts.tar.gz
sudo make -C arch-install-scripts-${VERSION}
sudo make -C arch-install-scripts-${VERSION} check
sudo make -C arch-install-scripts-${VERSION} PREFIX=/usr install
sudo wget https://gitlab.manjaro.org/applications/pacman-mirrors/-/raw/v4.19x-stable/conf/pacman-mirrors.conf -O /etc/pacman-mirrors.conf
sudo rm arch-install-scripts.tar.gz
sudo rm -r arch-install-scripts-${VERSION}
- id: install-calamares-tools
shell: bash
run: |
echo "### install-calamares-tools ###"
sudo git clone --depth 1 https://gitlab.manjaro.org/applications/calamares-tools.git
pushd calamares-tools
sudo install -d /usr/share/calamares/
sudo cp -rv schemas/ /usr/share/calamares/
popd
sudo rm -r calamares-tools
- id: install-mkinitcpio
shell: bash
env:
#VERSION: "30"
VERSION: "32"
run: |
echo "### install-mkinitcpio ###"
# sudo wget https://gitlab.archlinux.org/mkinitcpio/mkinitcpio/-/archive/v${VERSION}/mkinitcpio-v${VERSION}.tar.gz
sudo wget https://github.com/BigLinux-Package-Build/build-iso/raw/main/mkinitcpio/mkinitcpio-v${VERSION}.tar.gz
sudo tar -xf mkinitcpio-v${VERSION}.tar.gz
sudo make -C mkinitcpio-v${VERSION} install
# sudo wget https://github.com/BigLinux-Package-Build/build-iso/raw/main/mkinitcpio/mkinitcpio-${VERSION}.tar.gz
# sudo tar -xf mkinitcpio-${VERSION}.tar.gz
# sudo make -C mkinitcpio-${VERSION} install
sudo sed -i -e 's|File|Path|' /usr/share/libalpm/hooks/*hook
sudo rm mkinitcpio-v${VERSION}.tar.gz
sudo rm -r mkinitcpio-v${VERSION}
- id: install-manjaro-tools
shell: bash
env:
CUSTOM_REPO: ${{ inputs.custom-repo }}
run: |
echo "### install-manjaro-tools ###"
#make majaro-tools
sudo git clone --depth 1 https://gitlab.manjaro.org/tools/development-tools/manjaro-tools.git
pushd manjaro-tools
sudo make SYSCONFDIR=/etc PREFIX=/usr
sudo make SYSCONFDIR=/etc PREFIX=/usr install_base
sudo make SYSCONFDIR=/etc PREFIX=/usr install_yaml
sudo make SYSCONFDIR=/etc PREFIX=/usr install_iso
popd
sudo rm -r manjaro-tools
#add custom repo
if [ ! -z ${CUSTOM_REPO} ]; then
echo "## adding repo [${CUSTOM_REPO}]"
sudo sed -i -e "s/\[core\]/\[${CUSTOM_REPO}\]\nSigLevel = PackageRequired\nInclude = \/etc\/pacman\.d\/mirrorlist\n\n\[core\]/" /usr/share/manjaro-tools/pacman-multilib.conf
fi
#change mirror
# sudo sed -i "s|https://mirror.alpix.eu/manjaro|${{ inputs.build-mirror }}|" /lib/manjaro-tools/util.sh
mirror=$(cat /etc/pacman.d/mirrorlist | head -n1 | awk '{print $3}' | sed -ne 's/\(manjaro\).*/\1/p')
sudo sed -i "s|https://mirror.alpix.eu/manjaro|${mirror}|" /lib/manjaro-tools/util.sh
sudo sed -i '/ParallelDownloads/s/#//' /usr/share/manjaro-tools/pacman-multilib.conf
sudo sed -i '/ParallelDownloads/s/5/8/' /usr/share/manjaro-tools/pacman-multilib.conf
#
[ "$SCOPE" == "minimal" ] && unset SCOPE && unset OFFICE
[ "$OFFICE" == "false" ] && unset OFFICE
#source the version info from current release info
source <(curl -s https://gitlab.manjaro.org/packages/core/manjaro-release/-/raw/master/lsb-release)
sudo sed -i -e "s|dist_name=\$(get_distname)|dist_name=${DISTRIB_ID%Linux}|g" /usr/lib/manjaro-tools/util.sh
sudo sed -i -e 's|iso_name=$(get_osid)|iso_name=manjaro|g' /usr/lib/manjaro-tools/util.sh
sudo sed -i -e "s|dist_release=\$(get_release)|dist_release=${{ inputs.release-tag }}|g" /usr/lib/manjaro-tools/util.sh
sudo sed -i -e "s|dist_codename=\$(get_codename)|dist_codename=\"${CODE_NAME:-$DISTRIB_CODENAME}\"|g" /usr/lib/manjaro-tools/util.sh
# #troca busca de kerneis para pegar qualquer kernel
sudo sed -i '/_kernver=/s/_kernver=.*/_kernver=$(find $1\/usr\/lib\/modules\/ -type f -name version -exec cat {} +)/' /usr/lib/manjaro-tools/util-iso-boot.sh
# #disable kernel version verification
sudo sed -i '/${iso_kernel}/s/^/#/' /usr/lib/manjaro-tools/util-iso.sh
# Remove last } in /usr/lib/manjaro-tools/util-iso-image.sh
sudo sed -i ':a;$!{N;ba;};s/\(.*\)}/\1/' /usr/lib/manjaro-tools/util-iso-image.sh
# adicionar ao arquivo /usr/lib/manjaro-tools/util-iso-image.sh
echo ' #BigLinux clean
path=$1/usr/share/doc
if [[ -d $path ]]; then
rm -Rf $path/* &> /dev/null
fi
#BigLinux clean
path=$1/usr/share/man
if [[ -d $path ]]; then
rm -Rf $path/* &> /dev/null
fi
#Clean LibreOffice
path=$1/usr/lib/libreoffice/share/config
if [[ -d $path ]]; then
rm -f $path/images_karasa_jaga* &> /dev/null
rm -f $path/images_elementary* &> /dev/null
rm -f $path/images_sukapura* &> /dev/null
rm -f $path/images_colibre_svg.zip &> /dev/null
rm -f $path/images_sifr_dark_svg.zip &> /dev/null
rm -f $path/images_sifr_svg.zip &> /dev/null
rm -f $path/images_breeze_dark_svg.zip &> /dev/null
rm -f $path/images_breeze_svg.zip &> /dev/null
fi
#Clean LibreOffice
path=$1/usr/share/wallpapers
if [[ -d $path ]]; then
rm -Rf $path/Altai
rm -Rf $path/BytheWater
rm -Rf $path/Cascade
rm -Rf $path/ColdRipple
rm -Rf $path/DarkestHour
rm -Rf $path/EveningGlow
rm -Rf $path/Flow
rm -Rf $path/FlyingKonqui
rm -Rf $path/IceCold
rm -Rf $path/Kokkini
rm -Rf $path/Next
rm -Rf $path/Opal
rm -Rf $path/Patak
rm -Rf $path/SafeLanding
rm -Rf $path/summer_1am
rm -Rf $path/Autumn
rm -Rf $path/Canopee
rm -Rf $path/Cluster
rm -Rf $path/ColorfulCups
rm -Rf $path/Elarun
rm -Rf $path/FallenLeaf
rm -Rf $path/Fluent
rm -Rf $path/Grey
rm -Rf $path/Kite
rm -Rf $path/MilkyWay
rm -Rf $path/OneStandsOut
rm -Rf $path/PastelHills
rm -Rf $path/Path
rm -Rf $path/Shell
rm -Rf $path/Volna
fi
}' | sudo tee -a /usr/lib/manjaro-tools/util-iso-image.sh
# Add root-overlay
sudo sed -i '/copy_overlay "${profile_dir}\/root-overlay" "${path}"/a [[ -e ${profile_dir}\/root-overlay ]] && copy_overlay "${profile_dir}\/root-overlay" "${path}"' /usr/lib/manjaro-tools/util-iso.sh
# bootsplash
# if [ -z "$(grep bootsplash-${{ inputs.edition }} /usr/share/manjaro-tools/mkinitcpio.conf)" ]; then
# sudo sed -i "s|keyboard keymap|keyboard keymap bootsplash-${{ inputs.edition }}|g" /usr/share/manjaro-tools/mkinitcpio.conf
# fi
# plymouth
# Add video modules to use plymouth in live mode
sudo sed -i "s|loop dm-snapshot|loop dm-snapshot amdgpu radeon i915 nouveau mgag200 bochs virtio-gpu qxl vmwgfx cirrus vmwgfx vboxvideo|g" /usr/share/manjaro-tools/mkinitcpio.conf
# Enable plymouth and kms
sudo sed -i "s|keyboard keymap|keyboard keymap kms plymouth|g" /usr/share/manjaro-tools/mkinitcpio.conf
# Disable pxe boot
#sudo sed -i "s|miso_pxe_common miso_pxe_http miso_pxe_nbd miso_pxe_nfs||g" /usr/share/manjaro-tools/mkinitcpio.conf
#add big update repository
if [ -z "$(grep biglinux-keyring /usr/share/manjaro-tools/pacman-default.conf)" ];then
sudo sed -i '/SyncFirst/s/$/ biglinux-keyring/' /usr/share/manjaro-tools/pacman-default.conf
fi
if [ -z "$(grep biglinux-update-stable /usr/share/manjaro-tools/pacman-default.conf)" ];then
sudo sed -i '/\[core\]/{h;s/.*/\[biglinux-update-stable\]/;p;x;}' /usr/share/manjaro-tools/pacman-default.conf
sudo sed -i '/\[core\]/{h;s/.*/SigLevel = PackageRequired/;p;x;}' /usr/share/manjaro-tools/pacman-default.conf
sudo sed -i '/\[core\]/{h;s/.*/Server = https:\/\/repo.biglinux.com.br\/update-stable\/$arch/;p;x;}' /usr/share/manjaro-tools/pacman-default.conf
sudo sed -i '/\[core\]/{h;s/.*//;p;x;}' /usr/share/manjaro-tools/pacman-default.conf
fi
if [ -z "$(grep biglinux-keyring /usr/share/manjaro-tools/pacman-multilib.conf)" ];then
sudo sed -i '/SyncFirst/s/$/ biglinux-keyring/' /usr/share/manjaro-tools/pacman-multilib.conf
fi
if [ -z "$(grep biglinux-update-stable /usr/share/manjaro-tools/pacman-multilib.conf)" ];then
sudo sed -i '/\[core\]/{h;s/.*/\[biglinux-update-stable\]/;p;x;}' /usr/share/manjaro-tools/pacman-multilib.conf
sudo sed -i '/\[core\]/{h;s/.*/SigLevel = PackageRequired/;p;x;}' /usr/share/manjaro-tools/pacman-multilib.conf
sudo sed -i '/\[core\]/{h;s/.*/Server = https:\/\/repo.biglinux.com.br\/update-stable\/$arch/;p;x;}' /usr/share/manjaro-tools/pacman-multilib.conf
sudo sed -i '/\[core\]/{h;s/.*//;p;x;}' /usr/share/manjaro-tools/pacman-multilib.conf
fi
# # Disable remove pkgs cache
sudo sed -i 's|path=$1/var/lib/pacman/sync|path=$1/usr/share/man|'g /usr/lib/manjaro-tools/util-iso-image.sh
# #select folder with isoprofiles
# mkdir -p ~/.config/manjaro-tools/
# echo "run_dir=$workdir/$isoprofilesdir" > ~/.config/manjaro-tools/iso-profiles.conf
# Faster compression
if [ "${{ inputs.bigbranch }}" != "stable" ];then
sudo sed -i 's|-Xcompression-level 20|-Xcompression-level 6|g' /usr/lib/manjaro-tools/util-iso.sh
sudo sed -i 's|256K|1024K|g' /usr/lib/manjaro-tools/util-iso.sh
else
sudo sed -i 's|256K|1024K|g' /usr/lib/manjaro-tools/util-iso.sh
fi
# #select folder with isoprofiles
# mkdir -p ~/.config/manjaro-tools/
# cd ..
# echo "run_dir=$PWD/iso-profiles" > ~/.config/manjaro-tools/iso-profiles.conf
- id: checkout-iso-profiles
shell: bash
env:
REPO: ${{ inputs.iso-profiles-repo }}
BRANCH: ${{ inputs.iso-profiles-branch }}
run: sudo git clone ${BRANCH:+--branch ${BRANCH}} --depth 1 ${REPO} iso-profiles
# ## Tmate ##
# - name: Setup TMATE Session
# uses: mxschmitt/action-tmate@v3
# # if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- id: image-build
shell: bash
env:
EDITION: ${{ inputs.edition }}
MANJAROBRANCH: ${{ inputs.manjarobranch }}
BIGBRANCH: ${{ inputs.bigbranch }}
SCOPE: ${{ inputs.scope }}
VERSION: ${{ inputs.version }}
KERNEL: ${{ inputs.kernel }}
# CODE_NAME: ${{ inputs.code-name }}
OFFICE: ${{ inputs.office-chooser }}
MESA: ${{ inputs.mesa }}
EXTRAREPO: ${{ inputs.extrarepo }}
run: |
## BigLinux Pre Config Build ISO
echo "## BigLinux Pre Config Build ISO ##"
# cd iso-profiles/biglinux-make-iso-profiles
# sudo bash -x make-iso-profiles ci/cd $MESA $EXTRAREPO $EDITION
# cd ../..
#MESA
if [ "$KERNEL" = "oldLts" ]; then
echo '
mesa-amber
lib32-mesa-amber' | sudo tee -a iso-profiles/community/$EDITION/Packages-Root
elif [ "$KERNEL" = "latest" ]; then
echo '
mesa-tkg-git
lib32-mesa-tkg-git' | sudo tee -a iso-profiles/community/$EDITION/Packages-Root
sudo sed -i '/libva-mesa/d' iso-profiles/community/$EDITION/Packages-Desktop
sudo sed -i '/libva-mesa/d' iso-profiles/community/$EDITION/Packages-Mhwd
sudo sed -i '/vulkan-swrast/d' iso-profiles/community/$EDITION/Packages-Desktop
fi
#KERNEL
if [ "$KERNEL" = "oldLts" ];then
oldLts=$(curl -s https://www.kernel.org/feeds/kdist.xml | grep ": longterm" | sed 's/^.*<title>//' | sed 's/<\/title>.*$//' | cut -d ":" -f1 | rev | cut -d "." -f2,3 | rev | head -n2 | sed 's/\.//g' | tail -n1)
KERNEL=$oldLts
elif [ "$KERNEL" = "atualLts" ];then
atualLts=$(curl -s https://www.kernel.org/feeds/kdist.xml | grep ": longterm" | sed 's/^.*<title>//' | sed 's/<\/title>.*$//' | cut -d ":" -f1 | rev | cut -d "." -f2,3 | rev | head -n1 | sed 's/\.//g')
KERNEL=$atualLts
elif [ "$KERNEL" = "latest" ];then
kernelVer=$(pacman -Sl | grep linux[0-9] | grep core | grep -vE "rc|headers" | sort | tail -n1 | cut -d " " -f2 | sed 's/linux//')
echo "linux-latest" | sudo tee -a iso-profiles/community/$EDITION/Packages-Root
KERNEL=$kernelVer
fi
# Stable
if [ "$BIGBRANCH" = "stable" ];then
echo "BUILD_RELEASE=${{ inputs.release-tag }}" | cut -d "_" -f1 | sudo tee -a iso-profiles/community/$EDITION/root-overlay/etc/big-release
fi
# Beta
if [ "$BIGBRANCH" = "beta" ];then
echo "BUILD_RELEASE=${{ inputs.release-tag }}" | sudo tee -a iso-profiles/community/$EDITION/root-overlay/etc/big-release
fi
# Development
if [ "$BIGBRANCH" = "development" ];then
#add repo testing
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/\[biglinux-testing\]/;p;x;}' iso-profiles/community/$EDITION/user-repos.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/\[biglinux-testing\]/;p;x;}' iso-profiles/community/$EDITION/live-overlay/etc/pacman.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/\[biglinux-testing\]/;p;x;}' iso-profiles/community/$EDITION/root-overlay/etc/pacman.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/SigLevel = PackageRequired/;p;x;}' iso-profiles/community/$EDITION/user-repos.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/SigLevel = PackageRequired/;p;x;}' iso-profiles/community/$EDITION/live-overlay/etc/pacman.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/SigLevel = PackageRequired/;p;x;}' iso-profiles/community/$EDITION/root-overlay/etc/pacman.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/Server = https:\/\/repo.biglinux.com.br\/testing\/$arch/;p;x;}' iso-profiles/community/$EDITION/user-repos.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/Server = https:\/\/repo.biglinux.com.br\/testing\/$arch/;p;x;}' iso-profiles/community/$EDITION/live-overlay/etc/pacman.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*/Server = https:\/\/repo.biglinux.com.br\/testing\/$arch/;p;x;}' iso-profiles/community/$EDITION/root-overlay/etc/pacman.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*//;p;x;}' iso-profiles/community/$EDITION/user-repos.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*//;p;x;}' iso-profiles/community/$EDITION/live-overlay/etc/pacman.conf
sudo sed -i '/\[biglinux-stable\]/{h;s/.*//;p;x;}' iso-profiles/community/$EDITION/root-overlay/etc/pacman.conf
#add anti-ruscher
echo anti-ruscher | sudo tee -a iso-profiles/community/$EDITION/Packages-Root
echo "BUILD_RELEASE=${{ inputs.release-tag }}" | sudo tee -a iso-profiles/community/$EDITION/root-overlay/etc/big-release
fi
#Build Release and Unix Time
echo "BUILD_BRANCH=$BIGBRANCH" | sudo tee -a iso-profiles/community/$EDITION/root-overlay/etc/big-release
echo "UNIX_TIMESTAMP=$(( $(date +%s) / 86400 ))" | sudo tee -a iso-profiles/community/$EDITION/root-overlay/etc/big-release
sudo rm -r iso-profiles/biglinux-make-iso-profiles
echo $KERNEL
echo $EDITION
echo $MANJAROBRANCH
echo $BIGBRANCH
echo $MESA
sudo buildiso ${SCOPE:+-f} -p $EDITION -b $MANJAROBRANCH -k linux${KERNEL} ${OFFICE:+-o}
sudo rm -Rf /var/lib/manjaro-tools/buildiso/*
OUTPUT_ISO_PATH=$(find /var/cache/manjaro-tools/iso -type f -name "*.iso" -exec stat -c '%Y %n' {} \; | sort -nr | awk 'NR==1 {print $2}')
#TARGET_ISO_PATH=$(basename $OUTPUT_ISO_PATH)
if [ "$BIGBRANCH" = "development" ];then
TARGET_ISO_PATH=${EDITION}_DEVELOPMENT_${{ inputs.release-tag }}_k${KERNEL}.iso
elif [ "$BIGBRANCH" = "beta" ];then
TARGET_ISO_PATH=${EDITION}_BETA_$(echo ${{ inputs.release-tag }} | cut -d "_" -f1 )_k${KERNEL}.iso
else
TARGET_ISO_PATH=${EDITION}_$(echo ${{ inputs.release-tag }} | cut -d "_" -f1 )_k${KERNEL}.iso
fi
sudo mv $OUTPUT_ISO_PATH ./$TARGET_ISO_PATH
# echo "::set-output name=file-path::$TARGET_ISO_PATH"
echo "file-path=$TARGET_ISO_PATH" >> $GITHUB_OUTPUT
FILE_PKG=$(find /var/cache/manjaro-tools/iso -type f -name "*-pkgs.txt" -exec stat -c '%Y %n' {} \; | sort -nr | awk 'NR==1 {print $2}')
sudo mv $FILE_PKG ./${TARGET_ISO_PATH}.pkgs
sudo rm -r iso-profiles
ls -lh
echo ${{ steps.image-build.outputs.file-path }}
- id: hash
shell: bash
run: |
echo "## calculating hashes"
md5sum ${{ steps.image-build.outputs.file-path }} >${{ steps.image-build.outputs.file-path }}.md5
# sha1sum ${{ steps.image-build.outputs.file-path }} >${{ steps.image-build.outputs.file-path }}.sha1
# sha256sum ${{ steps.image-build.outputs.file-path }} >${{ steps.image-build.outputs.file-path }}.sha256
# sha512sum ${{ steps.image-build.outputs.file-path }} >${{ steps.image-build.outputs.file-path }}.sha512
#- id: gpg_sign
#shell: bash
#run: |
## if is not yet supported in composite https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md#if-condition
#if [ -z "${{ inputs.gpg-secret-key-base64 }}" ]; then
#echo "## no gpg secret given"
#exit 0
#fi
#echo "## gpg signing"
#cat <(echo -e "${{ inputs.gpg-secret-key-base64 }}" | base64 --decode) | gpg --batch --import &>/dev/null
#gpg --pinentry-mode loopback --passphrase "${{ inputs.gpg-passphrase }}" --detach-sign ./${{ steps.image-build.outputs.file-path }}
- id: upload-prepare
shell: bash -O extglob {0}
run: |
echo "## ssh setup"
mkdir -p /home/runner/.ssh
touch /home/runner/.ssh/github_actions
chmod 600 /home/runner/.ssh/github_actions
ssh-agent -a /tmp/ssh_agent.sock > /dev/null
# echo "::set-output name=upload-files::./${{ steps.image-build.outputs.file-path }}+(|.sha*|.pkgs|.sig|.torrent|.md5)"
echo "upload-files=./${{ steps.image-build.outputs.file-path }}+(|.sha*|.pkgs|.sig|.torrent|.md5)" >> $GITHUB_OUTPUT
mkdir -p ${{ inputs.edition }}/${{ inputs.version }}
- id: Torrent
shell: bash -O extglob {0}
env:
EXTRAREPO: ${{ inputs.extrarepo }}
run: |
echo "### Torrent ###"
#mktorrent -v -a udp://tracker.opentrackr.org:1337 -l 21 \
#-w "https://iso.biglinux.com.br/${{ inputs.edition }}/${{ inputs.version }}/${{ steps.image-build.outputs.file-path }}" \
#-o ${{ steps.image-build.outputs.file-path }}.torrent ${{ steps.image-build.outputs.file-path }}
if [ "${{ inputs.bigbranch }}" = "stable" ];then
mktorrent -v -a udp://tracker.opentrackr.org:1337 -l 21 \
-w "https://iso.biglinux.com.br/${{ steps.image-build.outputs.file-path }}" \
-w "https://osdn.net/projects/biglinux/storage/${{ steps.image-build.outputs.file-path }}" \
-o ${{ steps.image-build.outputs.file-path }}.torrent ${{ steps.image-build.outputs.file-path }}
fi
- id: upload-github-release
shell: bash -O extglob {0}
env:
EXTRAREPO: ${{ inputs.extrarepo }}
run: |
echo "### upload-github-release ###"
# if is not yet supported in composite https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md#if-condition
# if [ -z "${{ inputs.release-tag }}" ]; then
# echo "## no release tag given"
# exit 0
# fi
if [ "${{ inputs.bigbranch }}" = "stable" ];then
echo "## github upload"
release=$(echo ${{ steps.image-build.outputs.file-path }} | sed 's/_k.*//')
echo ${{ github.token }} | gh auth login --with-token
gh release create ${release} --title ${release} --repo ${{ github.repository }} --notes "automated release" || echo "release already exists"
GITHUB_LINK=https://github.com/${GITHUB_REPOSITORY}/releases/download/${release}
if [[ -z "$(du --threshold=1950M ${{ steps.image-build.outputs.file-path }})" ]]; then
# iso is small enough to upload already
gh release upload ${release} --repo ${{ github.repository }} --clobber \
${{ steps.upload-prepare.outputs.upload-files }}
else
# iso is too big - creating a split-zip
zip -j -s 1950m ${{ steps.image-build.outputs.file-path }}.zip ${{ steps.image-build.outputs.file-path }}
REMOTE_FILES=$(find . -maxdepth 1 -name "*.z*" -exec basename {} \; | xargs -I{} echo "-w \"${GITHUB_LINK}/{}\"")
gh release upload ${release} --repo ${{ github.repository }} --clobber \
./${{ steps.image-build.outputs.file-path }}+(.z*|.sha*|.pkgs|.sig|.torrent|.md5)
fi
else
echo "ISO testing subir em outro repo"
fi
#- name: upload-sourceforge
#shell: bash -O extglob {0}
#env:
#SSH_AUTH_SOCK: /tmp/ssh_agent.sock
#run: |
## if is not yet supported in composite https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md#if-condition
#if [ -z "${{ inputs.sf-project }}" ] || [ -z "${{ inputs.sf-user }}" ] || [ -z "${{ inputs.sf-key }}" ]; then
#echo "## not (all) credentials given for sourceforge upload"
#exit 0
#fi
#echo "## sourceforge upload"
#ssh-keyscan -t rsa frs.sourceforge.net >> /home/runner/.ssh/known_hosts
#echo "${{ inputs.sf-key }}" >> /home/runner/.ssh/github_actions
#ssh-add /home/runner/.ssh/github_actions
### create target dir
#rsync -vaP --stats -e ssh ${{ inputs.edition }} \
#${{ inputs.sf-user }}@frs.sourceforge.net:/home/frs/project/${{ inputs.sf-project }}/
### upload
#rsync -vaP --stats -e ssh ${{ steps.upload-prepare.outputs.upload-files }} \
#${{ inputs.sf-user }}@frs.sourceforge.net:/home/frs/project/${{ inputs.sf-project }}/${{ inputs.edition }}/${{ inputs.version }}/
#- name: upload-osdn
#shell: bash -O extglob {0}
#env:
#SSH_AUTH_SOCK: /tmp/ssh_agent.sock
#run: |
## if is not yet supported in composite https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md#if-condition
#if [ -z "${{ inputs.osdn-project }}" ] || [ -z "${{ inputs.osdn-user }}" ] || [ -z "${{ inputs.osdn-key }}" ]; then
#echo "## not (all) credentials given for osdn upload"
#exit 0
#fi
#echo "## osdn upload"
#ssh-keyscan -t rsa storage.osdn.net >> /home/runner/.ssh/known_hosts
#echo "${{ inputs.osdn-key }}" >> /home/runner/.ssh/github_actions
#ssh-add /home/runner/.ssh/github_actions
### create target dir
#rsync -vaP --stats -e ssh ${{ inputs.edition }} \
#${{ inputs.osdn-user }}@storage.osdn.net:/storage/groups/m/ma/${{ inputs.osdn-project }}/
#OSDN_GROUP=$(echo ${{ inputs.osdn-project }} | cut -c 1)/$(echo ${{ inputs.osdn-project }} | cut -c 1-2)
#rsync -vaP --stats -e ssh ${{ steps.upload-prepare.outputs.upload-files }} \
#${{ inputs.osdn-user }}@storage.osdn.net:/storage/groups/${OSDN_GROUP}/${{ inputs.osdn-project }}/${{ inputs.edition }}/${{ inputs.version }}/
#- name: upload-cdn77
#shell: bash -O extglob {0}
#run: |
## if is not yet supported in composite https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md#if-condition
#if [ -z "${{ inputs.cdn77-host }}" ] || [ -z "${{ inputs.cdn77-user }}" ] || [ -z "${{ inputs.cdn77-pwd }}" ]; then
#echo "## not (all) credentials given for cdn77 upload"
#exit 0
#fi
#echo "## cdn77 upload"
#mktorrent -v -a udp://tracker.opentrackr.org:1337 -l 21 \
#-w "https://download.manjaro.org/${{ inputs.edition }}/${{ inputs.version }}/${{ steps.image-build.outputs.file-path }}" \
#-o ${{ steps.image-build.outputs.file-path }}.torrent ${{ steps.image-build.outputs.file-path }}
#ssh-keyscan -t rsa ${{ inputs.cdn77-host }} >> /home/runner/.ssh/known_hosts
## create target dir
#sshpass -p "${{ inputs.cdn77-pwd }}" rsync -vaP --stats -e ssh ${{ inputs.edition }} \
#${{ inputs.cdn77-user }}@${{ inputs.cdn77-host }}:/www/
## upload
#sshpass -p "${{ inputs.cdn77-pwd }}" rsync -vaP \
#--stats -e ssh ${{ steps.upload-prepare.outputs.upload-files }} \
#${{ inputs.cdn77-user }}@${{ inputs.cdn77-host }}:/www/${{ inputs.edition }}/${{ inputs.version }}/