forked from puppylinux-woof-CE/woof-CE
-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (164 loc) · 7.3 KB
/
build.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: build
on:
schedule:
- cron: '0 0 1,15 * *'
workflow_dispatch:
workflow_run:
workflows: [kernel-kit]
branches: [testing]
types:
- completed
jobs:
build:
if: (github.event_name != 'schedule') || (github.event_name == 'schedule' && github.repository == 'puppylinux-woof-CE/woof-CE' && github.ref == 'refs/heads/testing') || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- arch: x86
compat-distro: slackware
compat-distro-version: 14.2
kernel: 4.19.x-x86
- arch: x86
compat-distro: debian
compat-distro-version: bullseye
kernel: 4.19.x-x86
- arch: x86_64
compat-distro: slackware64
compat-distro-version: 14.2
kernel: 4.19.x-x86_64
- arch: x86_64
compat-distro: debian
compat-distro-version: bullseye64
kernel: 5.10.x-x86_64
- arch: x86_64
compat-distro: ubuntu
compat-distro-version: focal64
kernel: 5.4.x-x86_64
- arch: x86_64
compat-distro: slackware64
compat-distro-version: "15.0"
kernel: 5.10.x-x86_64
- arch: arm
compat-distro: debian
compat-distro-version: bullseye-veyron-speedy
kernel: 5.4.x-veyron-speedy
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create cache directories
run: |
mkdir -p local-repositories petbuild-sources petbuild-cache petbuild-output
ln -s `pwd`/local-repositories ../local-repositories
- name: Get cached local-repositories
uses: actions/cache@v2
with:
path: local-repositories
key: ${{ github.workflow }}-${{ matrix.arch }}-${{ matrix.compat-distro }}-${{ matrix.compat-distro-version }}-local-repositories-${{ github.sha }}
restore-keys: |
${{ github.workflow }}-local-repositories-
- name: Prepare build environment
run: |
[ -f local-repositories/vercmp ] || (curl https://raw.githubusercontent.com/puppylinux-woof-CE/initrd_progs/master/pkg/w_apps_static/w_apps/vercmp.c | gcc -x c -o ../local-repositories/vercmp -)
sudo install -m 755 local-repositories/vercmp /usr/local/bin/vercmp
sudo install -D -m 644 woof-code/rootfs-skeleton/usr/local/petget/categories.dat /usr/local/petget/categories.dat
echo "dash dash/sh boolean false" | sudo debconf-set-selections
sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
sudo ln -s bash /bin/ash
[ "${{ matrix.arch }}" = "x86" ] && echo -e '#!/bin/sh\nexec linux32 "$@"' | sudo tee /usr/local/bin/linuxn || echo -e '#!/bin/sh\nexec "$@"' | sudo tee /usr/local/bin/linuxn
sudo chmod 755 /usr/local/bin/linuxn
- name: merge2out
timeout-minutes: 5
run: yes "" | sudo -E linuxn ./merge2out woof-distro/${{ matrix.arch }}/${{ matrix.compat-distro }}/${{ matrix.compat-distro-version }}
- name: Reduce compression level
if: github.event_name != 'workflow_dispatch'
run: |
echo | sudo tee -a ../woof-out_*/_00build.conf
echo 'SFSCOMP="-comp zstd -Xcompression-level 15 -no-exports -no-xattrs"' | sudo tee -a ../woof-out_*/_00build.conf
- name: 0setup
timeout-minutes: 10
run: |
cd ../woof-out_*
sudo -E linuxn ./0setup
- name: 1download
timeout-minutes: 120
run: |
cd ../woof-out_*
sudo -E linuxn ./1download
- name: 2createpackages
timeout-minutes: 30
run: |
cd ../woof-out_*
echo | sudo -E linuxn ./2createpackages
- name: Get cached kernel-kit output
uses: dawidd6/action-download-artifact@v2
with:
repo: puppylinux-woof-CE/woof-CE
branch: testing
workflow: kernel-kit.yml
workflow_conclusion: success
name: kernel-kit-output-${{ matrix.kernel }}
path: output
- name: Move cached kernel-kit output
run: sudo mv output ../woof-out_*/kernel-kit/
- name: Get cached petbuild-sources
uses: actions/cache@v2
with:
path: petbuild-sources
key: ${{ github.workflow }}-${{ matrix.arch }}-${{ matrix.compat-distro }}-${{ matrix.compat-distro-version }}-petbuild-sources-${{ github.sha }}
restore-keys: |
${{ github.workflow }}-${{ matrix.arch }}-${{ matrix.compat-distro }}-${{ matrix.compat-distro-version }}-petbuild-sources-
- name: Get cached petbuild-cache
if: matrix.arch == 'arm' && github.event_name != 'workflow_dispatch'
uses: actions/cache@v2
with:
path: petbuild-cache
key: ${{ github.workflow }}-${{ matrix.arch }}-${{ matrix.compat-distro }}-${{ matrix.compat-distro-version }}-petbuild-cache-${{ github.sha }}
restore-keys: |
${{ github.workflow }}-${{ matrix.arch }}-${{ matrix.compat-distro }}-${{ matrix.compat-distro-version }}-petbuild-cache-
- name: Get cached petbuild-output
if: github.event_name != 'workflow_dispatch'
uses: actions/cache@v2
with:
path: petbuild-output
key: ${{ github.workflow }}-${{ matrix.arch }}-${{ matrix.compat-distro }}-${{ matrix.compat-distro-version }}-petbuild-output-${{ github.sha }}
restore-keys: |
${{ github.workflow }}-${{ matrix.arch }}-${{ matrix.compat-distro }}-${{ matrix.compat-distro-version }}-petbuild-output-
- name: Install x86 3builddistro dependencies
if: matrix.arch == 'x86'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends libuuid1:i386
- name: Install ARM 3builddistro dependencies
if: matrix.arch == 'arm'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends vboot-kernel-utils u-boot-tools device-tree-compiler cgpt qemu-user-static binfmt-support
sudo ln -s /usr/bin/mount /usr/local/bin/mount-FULL
- name: Install cdrtools
if: matrix.arch != 'arm'
run: |
[ -f local-repositories/mkisofs ] || (curl -L https://sourceforge.net/projects/cdrtools/files/alpha/cdrtools-3.02a09.tar.bz2/download | tar -xjf- && cd cdrtools-3.02 && make -j`nproc` && mv mkisofs/OBJ/x86_64-linux-cc/mkisofs ../local-repositories/mkisofs)
sudo install -m 755 local-repositories/mkisofs /usr/local/bin/mkisofs
- name: 3builddistro
timeout-minutes: 180
run: |
sudo chown -R root:root petbuild-output
sudo mv petbuild-{sources,cache,output} ../woof-out_*/
cd ../woof-out_*
sudo -E HOME=/root linuxn ./3builddistro
sudo mv petbuild-{sources,cache,output} $GITHUB_WORKSPACE/
- name: Move build output
run: |
for i in `ls ../woof-out_*/woof-output-*/*.{sfs,iso} 2>/dev/null`; do sudo mv -f $i .; done
for i in `ls ../woof-out_*/woof-output-*/*.img 2>/dev/null`; do sudo gzip -1 $i && sudo mv -f $i.gz .; done
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ github.workflow }}-${{ matrix.arch }}-${{ matrix.compat-distro }}-${{ matrix.compat-distro-version }}-${{ github.run_number }}
path: |
*.iso
*.sfs
*.img.gz
retention-days: 15