-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.75 KB
/
build.yaml
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
name: Build
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-push:
runs-on: ubuntu-latest
container:
image: archlinux:latest
env:
makepkg_flags: "-f"
pkgsdir: "/home/nonroot/pkgs"
steps:
- name: Install latest git
run: |
pacman -Syy --noconfirm git
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Create non_root user
run: |
useradd nonroot && mkdir /home/nonroot && chown -R nonroot:nonroot /home/nonroot
- name: Set nonroot user in sudoers
run: |
echo 'nonroot ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
- name: Set root user in sudoers
run: |
echo 'root ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
- name: Enable multilib
run: |
echo -e '[multilib]\nInclude = /etc/pacman.d/mirrorlist\n' >> /etc/pacman.conf
- name: Enable extra
run: |
sed -i '/^#\[extra\]/{N;s/#//g}' /etc/pacman.conf
- name: Install dependencies
run: |
pacman -Syyu --noconfirm && pacman -S --noconfirm just base-devel sudo xorgproto openssh
- name: Set source permissions
run: |
chown -R nonroot:nonroot .
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Build packages
run: |
sudo -E -u nonroot just makepkg_flags=$makepkg_flags all
- name: Show sedspkg diff
run: |
cd $pkgsdir
sudo -u nonroot git diff
- name: Commit and release
run: |
sudo -u nonroot just push-packages