-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (92 loc) · 3.68 KB
/
Copy pathlinux.yml
File metadata and controls
109 lines (92 loc) · 3.68 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
109
# 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=(\\\"psn::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:latest
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
if [ ! -L /etc/portage/make.profile ]; then
profile_path="$(find /var/db/repos/gentoo/profiles/default/linux/amd64 -type f -name make.defaults | head -n1)"
if [ -n "${profile_path}" ]; then
ln -snf "$(dirname "${profile_path}")" /etc/portage/make.profile
fi
fi
- name: Configure local overlay
run: |
mkdir -p /var/db/repos/localrepo/{metadata,profiles,app-misc/psn}
cp "${GITHUB_WORKSPACE}/packaging/gentoo/app-misc/psn/psn-9999.ebuild" /var/db/repos/localrepo/app-misc/psn/
cp "${GITHUB_WORKSPACE}/packaging/gentoo/app-misc/psn/metadata.xml" /var/db/repos/localrepo/app-misc/psn/
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/psn-9999 **\n" > /etc/portage/package.accept_keywords/localrepo
- name: Validate ebuild and resolve install plan
run: |
FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -mount-sandbox -usersandbox -userpriv" \
ebuild /var/db/repos/localrepo/app-misc/psn/psn-9999.ebuild manifest
FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -mount-sandbox -usersandbox -userpriv" \
emerge -pv =app-misc/psn-9999
nix:
runs-on: ubuntu-latest
container:
image: nixos/nix:2.34.0
steps:
- name: Enable flakes
run: |
mkdir -p /etc/nix
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
- name: Clone repository
run: |
git init /psn
git -C /psn fetch --depth 1 "https://github.com/${GITHUB_REPOSITORY}.git" "${GITHUB_REF}"
git -C /psn checkout FETCH_HEAD
- name: Build nix flake
run: |
cd /psn
nix build . --option sandbox false --print-build-logs