-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.66 KB
/
repo.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
name: build repository
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
container:
image: archlinux
env:
CCACHE_DIR: /tmp/ccache
steps:
- uses: actions/checkout@v2
- name: install base-devel
run: |
cat pacman.conf >> /etc/pacman.conf
pacman -Syuq --needed --noconfirm base-devel ccache fd git namcap
- name: setup makepkg
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
echo "PKGDEST=$PWD/pkgs" >> $GITHUB_ENV
useradd -M builduser && chown -R builduser .
echo "builduser ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/builduser
sed -i -e 's/!ccache/ccache/' /etc/makepkg.conf
cat makepkg.conf >> /etc/makepkg.conf
- uses: actions/cache@v1
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ github.sha }}
restore-keys: |
ccache-
- run: sudo -Eu builduser ccache -z
- name: build packages
env:
BUILDDIR: /tmp/makepkg
PACKAGER: ${{ secrets.PACKAGER }}
run: |
for pkg in $(fd -a -t directory); do
cd "$pkg"
echo "==> Building $(basename "$pkg")"
yes | sudo -Eu builduser makepkg -crs --noconfirm
done
- name: create repo db
run: repo-add ${{ env.PKGDEST }}/rsa.db.tar.zst ${{ env.PKGDEST }}/*.pkg.tar.zst
- run: sudo -Eu builduser ccache --show-stats
- run: ls -Ahl ${{ env.PKGDEST }}
- uses: crazy-max/ghaction-github-pages@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
target_branch: gh-pages
build_dir: pkgs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}