-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (90 loc) · 3.64 KB
/
Copy pathlinux.yml
File metadata and controls
108 lines (90 loc) · 3.64 KB
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
# Copyright (c) 2026 l5yth
# SPDX-License-Identifier: Apache-2.0
name: Linux
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pkgbuild:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install build dependencies
run: pacman -Syu --noconfirm --needed base-devel git sudo rust
- name: Build and install AUR package
run: |
useradd -m builder
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
chown -R builder:builder "${GITHUB_WORKSPACE}"
su - builder -c "cd '${GITHUB_WORKSPACE}/packaging/archlinux' && sed -i \"s|^source=.*$|source=(\\\"lsu::git+https://github.com/${GITHUB_REPOSITORY}.git#commit=${GITHUB_SHA}\\\")|\" PKGBUILD && makepkg --syncdeps --noconfirm --cleanbuild --clean --install"
ebuild:
runs-on: ubuntu-latest
container:
image: gentoo/stage3:systemd
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Bootstrap Gentoo repo and profile
run: |
mkdir -p /etc/portage/repos.conf
cat > /etc/portage/repos.conf/gentoo.conf <<'EOF'
[gentoo]
location = /var/db/repos/gentoo
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes
EOF
mkdir -p /var/db/repos/gentoo
emerge --sync --quiet
- name: Configure local overlay
run: |
mkdir -p /var/db/repos/localrepo/{metadata,profiles,app-misc/lsu}
cp "${GITHUB_WORKSPACE}/packaging/gentoo/app-misc/lsu/lsu-9999.ebuild" /var/db/repos/localrepo/app-misc/lsu/
cp "${GITHUB_WORKSPACE}/packaging/gentoo/app-misc/lsu/metadata.xml" /var/db/repos/localrepo/app-misc/lsu/
printf "localrepo\n" > /var/db/repos/localrepo/profiles/repo_name
cat > /var/db/repos/localrepo/metadata/layout.conf <<'EOF'
masters = gentoo
auto-sync = no
EOF
mkdir -p /etc/portage/repos.conf
cat > /etc/portage/repos.conf/localrepo.conf <<'EOF'
[localrepo]
location = /var/db/repos/localrepo
masters = gentoo
auto-sync = no
EOF
mkdir -p /etc/portage/package.accept_keywords
printf "=app-misc/lsu-9999 **\n" > /etc/portage/package.accept_keywords/localrepo
- name: Generate manifest
run: |
FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -mount-sandbox -usersandbox -userpriv" \
ebuild /var/db/repos/localrepo/app-misc/lsu/lsu-9999.ebuild manifest
- name: Install build dependencies
run: |
FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -mount-sandbox -usersandbox -userpriv" \
emerge --oneshot dev-vcs/git dev-lang/rust-bin
- name: Validate dependency resolution
run: |
FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -mount-sandbox -usersandbox -userpriv" \
emerge -pv =app-misc/lsu-9999
- name: Build ebuild
run: |
FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -mount-sandbox -usersandbox -userpriv" \
ebuild /var/db/repos/localrepo/app-misc/lsu/lsu-9999.ebuild fetch unpack compile test
nix:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Build Nix package
run: |
docker run --rm \
-v "${{ github.workspace }}":/repo \
-w /repo \
nixpkgs/nix-flakes \
sh -c 'git config --global --add safe.directory /repo && nix build .#'