-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (98 loc) · 5.07 KB
/
build.yml
File metadata and controls
109 lines (98 loc) · 5.07 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
name: Build BlazeNeuro
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 240
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get clean
df -h
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential bison flex texinfo gawk \
libncurses-dev bc libssl-dev libelf-dev parted rsync wget xz-utils \
libgmp-dev libmpfr-dev libmpc-dev libx11-dev libxft-dev python3 \
python3-pip gettext autoconf automake libtool pkg-config m4
- name: Create directory structure
run: |
sudo mkdir -p /mnt/lfs/{tools,sources,build,usr,boot,etc,var,home}
sudo mkdir -p /mnt/lfs/usr/{bin,lib,sbin}
sudo chown -R $USER:$USER /mnt/lfs
mkdir -p logs build
cp -r sources /mnt/lfs/ || mkdir -p /mnt/lfs/sources
- name: Download sources
run: |
mkdir -p sources
cd sources
declare -A urls=(
["binutils-2.42.tar.xz"]="https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz|https://mirrors.kernel.org/gnu/binutils/binutils-2.42.tar.xz"
["gcc-13.2.0.tar.xz"]="https://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz|https://mirrors.kernel.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz"
["glibc-2.39.tar.xz"]="https://ftp.gnu.org/gnu/glibc/glibc-2.39.tar.xz|https://mirrors.kernel.org/gnu/glibc/glibc-2.39.tar.xz"
["linux-6.7.4.tar.xz"]="https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.7.4.tar.xz|https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.7.4.tar.xz"
["bash-5.2.21.tar.gz"]="https://ftp.gnu.org/gnu/bash/bash-5.2.21.tar.gz|https://mirrors.kernel.org/gnu/bash/bash-5.2.21.tar.gz"
["coreutils-9.4.tar.xz"]="https://ftp.gnu.org/gnu/coreutils/coreutils-9.4.tar.xz|https://mirrors.kernel.org/gnu/coreutils/coreutils-9.4.tar.xz"
["findutils-4.9.0.tar.xz"]="https://ftp.gnu.org/gnu/findutils/findutils-4.9.0.tar.xz|https://mirrors.kernel.org/gnu/findutils/findutils-4.9.0.tar.xz"
["grep-3.11.tar.xz"]="https://ftp.gnu.org/gnu/grep/grep-3.11.tar.xz|https://mirrors.kernel.org/gnu/grep/grep-3.11.tar.xz"
["gzip-1.13.tar.xz"]="https://ftp.gnu.org/gnu/gzip/gzip-1.13.tar.xz|https://mirrors.kernel.org/gnu/gzip/gzip-1.13.tar.xz"
["tar-1.35.tar.xz"]="https://ftp.gnu.org/gnu/tar/tar-1.35.tar.xz|https://mirrors.kernel.org/gnu/tar/tar-1.35.tar.xz"
["xz-5.4.6.tar.xz"]="https://github.com/tukaani-project/xz/releases/download/v5.4.6/xz-5.4.6.tar.xz|https://tukaani.org/xz/xz-5.4.6.tar.xz"
["util-linux-2.39.3.tar.xz"]="https://www.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.3.tar.xz|https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-2.39.3.tar.xz"
["e2fsprogs-1.47.0.tar.gz"]="https://downloads.sourceforge.net/project/e2fsprogs/e2fsprogs/v1.47.0/e2fsprogs-1.47.0.tar.gz|https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.47.0/e2fsprogs-1.47.0.tar.gz"
["grub-2.12.tar.xz"]="https://ftp.gnu.org/gnu/grub/grub-2.12.tar.xz|https://mirrors.edge.kernel.org/gnu/grub/grub-2.12.tar.xz"
)
for file in "${!urls[@]}"; do
IFS='|' read -ra MIRRORS <<< "${urls[$file]}"
echo "Downloading $file"
success=0
for mirror in "${MIRRORS[@]}"; do
if wget --continue --tries=3 --waitretry=2 --timeout=20 "$mirror" -O "$file"; then
success=1
break
fi
echo "Failed from $mirror, trying next..."
rm -f "$file"
done
[ $success -eq 0 ] && { echo "All mirrors failed for $file"; exit 1; }
if [[ "$file" == *.xz ]]; then
xz -t "$file" || { echo "Corrupt: $file"; rm -f "$file"; exit 1; }
elif [[ "$file" == *.gz ]]; then
gzip -t "$file" || { echo "Corrupt: $file"; rm -f "$file"; exit 1; }
fi
done
ls -lh
# Copy to /mnt/lfs/sources for build
sudo cp -v *.tar.* /mnt/lfs/sources/ || true
- name: Build complete system
run: |
chmod +x build.sh
sudo ./build.sh all
- name: Upload build logs
if: always()
uses: actions/upload-artifact@v4
with:
name: build-logs
path: logs/
retention-days: 7
- name: Create system image
if: success()
run: |
cd /mnt/lfs
sudo tar czf $GITHUB_WORKSPACE/blazeneuro-rootfs.tar.gz .
- name: Upload system image
if: success()
uses: actions/upload-artifact@v4
with:
name: blazeneuro-system
path: blazeneuro-rootfs.tar.gz
retention-days: 30