-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
49 lines (40 loc) · 1.36 KB
/
entrypoint.sh
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
#!/bin/bash
set -e
cd /build
repo_full=$(cat ./repo)
repo_owner=$(echo $repo_full | cut -d/ -f1)
repo_name=$(echo $repo_full | cut -d/ -f2)
serv_name="aoxos"
pacman-key --init
pacman -Syu --noconfirm --needed sudo git base-devel wget
useradd builduser -m
chown -R builduser:builduser /build
git config --global --add safe.directory /build
sudo -u builduser gpg --keyserver keyserver.ubuntu.com --recv-keys 38DBBDC86092693E
passwd -d builduser
printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers
gpg --homedir /home/builduser/.gnupg --import ./gpg_key
rm ./gpg_key
gpg --list-keys --keyid-format=long
gpg --list-secret-keys --keyid-format=long
for i in gitkraken-wayland typst-git helix-git; do
status=13
git submodule update --init $i
cd $i
for i in $(sudo -u builduser makepkg --packagelist); do
package=$(basename $i)
wget https://github.com/$repo_owner/$repo_name/releases/download/packages/$package \
&& echo "Warning: $package already built, did you forget to bump the pkgver and/or pkgrel? It will not be rebuilt."
done
sudo -u builduser bash -c 'export MAKEFLAGS=j$(nproc) && makepkg --sign -s --noconfirm'||status=$?
# Package already built is fine.
if [ $status != 13 ]; then
exit 1
fi
cd ..
done
cp */*.pkg.tar.* ./
repo-add -v --sign ./$serv_name.db.tar.gz ./*.pkg.tar.zst
for i in *.db *.files; do
cp --remove-destination $(readlink $i) $i
done