-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (85 loc) · 3.2 KB
/
buildarm.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
name: buildarm
on:
workflow_dispatch:
jobs:
aarch64_job:
runs-on: ubuntu-18.04
name: build
steps:
- uses: actions/checkout@v1.0.0
- uses: darsvador/run-on-arch-action@v1.0.10
id: runcmd
with:
architecture: aarch64
distribution: archlinuxarm
run: |
echo "container is ready."
yes $'\n'|pacman -Syu base-devel unzip p7zip busybox rclone git
cp -rf /github/workspace/makepkg.conf /etc/
mkdir -p /home/build
useradd -d /home/build build
echo "$USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
mkdir -p ~/.config/rclone/
touch ~/.config/rclone/rclone.conf
echo -e '${{secrets.ONEDRIVE_CONFIG}}' >> ~/.config/rclone/rclone.conf
for pkg in `cat need-update`
do
cd /github/workspace/pkgbuild/"${pkg}"/
if [ -f "./aur" ];then
git clone https://aur.archlinux.org/${pkg}.git
cd ./${pkg}
sh ../aur
source PKGBUILD
pacman -S $makedepends --noconfirm
chown -R build /home/build
chown -R build /github
su -c "makepkg -d" build
elif [ -f "./PKGBUILD" ];then
source PKGBUILD
pacman -S $makedepends --noconfirm
chown -R build /home/build
chown -R build /github
su -c "makepkg -d" build
echo "Build finished"
else
echo "Skipping:No build files provided."
fi
chown -R `whoami` /github
mkdir -p /mnt/onedrive
if [[ `ls` == *"-aarch64.pkg"* ]];then
rclone move one:/arch-repo/aarch64/ one:/arch-archive/ --include "${pkg}-*.pkg.tar.xz"
rclone move one:/arch-repo/aarch64/ ./ --exclude "*.tar.xz"
repo-add ./coal.db.tar.gz ./*.pkg.tar.xz
rm -r coal.db coal.files
cp coal.db.tar.gz coal.db
cp coal.files.tar.gz coal.files
for p in `ls *.pkg.tar.xz`
do
rclone move ./${p} one:/arch-repo/aarch64/
done
for f in `ls coal*`
do
rclone move ./${f} one:/arch-repo/aarch64/
done
else
echo "Skipping:No packages found."
fi
echo "Upload finished"
done
rm-update:
runs-on: ubuntu-latest
needs: aarch64_job
steps:
- uses: actions/checkout@v2
- name: Remove need-update
run: |
rm need-update
git config --local user.email "w1301511091@hotmail.com"
git config --local user.name "oganesson0512"
git add .
git commit -m "Build" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}