forked from puppylinux-woof-CE/woof-CE
-
Notifications
You must be signed in to change notification settings - Fork 2
160 lines (158 loc) · 6.6 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
name: build
on:
workflow_call:
inputs:
repo:
type: string
required: true
ref:
type: string
required: true
name:
type: string
version:
type: string
arch:
type: string
required: true
compat-distro:
type: string
required: true
compat-distro-version:
type: string
required: true
kernel:
type: string
required: true
prefix:
type: string
artifact:
type: string
required: true
retention:
type: number
required: true
variant:
type: string
runner:
type: string
default: 'ubuntu-24.04'
jobs:
build:
runs-on: ${{ inputs.runner }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }}
- name: Create cache directories
run: |
mkdir -p local-repositories petbuild-sources petbuild-cache petbuild-output
- name: Get cached local-repositories
uses: actions/cache@v4
with:
path: local-repositories
key: local-repositories-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-${{ github.sha }}
restore-keys: |
local-repositories-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-
local-repositories-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-
- name: merge2out
timeout-minutes: 5
run: |
yes "" | sudo -E ./merge2out woof-distro/${{ inputs.arch }}/${{ inputs.compat-distro }}/${{ inputs.compat-distro-version }}
sudo chown -R root:root ../woof-out_*
sudo mkdir ../buildenv
sudo cp -a ../woof-out_* ../buildenv/
- name: Set name
if: ${{ inputs.name != '' }}
run: sudo sed -i 's/^DISTRO_NAME=.*/DISTRO_NAME="${{ inputs.name }}"/' ../woof-out_*/DISTRO_SPECS
- name: Set version
if: ${{ inputs.version != '' }}
run: sudo sed -i s/^DISTRO_VERSION=.*/DISTRO_VERSION=${{ inputs.version }}/ ../woof-out_*/DISTRO_SPECS
- name: Set file name prefix
if: ${{ inputs.prefix != '' }}
run: sudo sed -i s/^DISTRO_FILE_PREFIX=.*/DISTRO_FILE_PREFIX=${{ inputs.prefix }}/ ../woof-out_*/DISTRO_SPECS
- name: Set variant
if: ${{ inputs.variant != '' }}
run: echo "DISTRO_VARIANT=${{ inputs.variant }}" >> $GITHUB_ENV
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends debootstrap
[ ${{ inputs.compat-distro }} != devuan ] || curl https://git.devuan.org/devuan/debootstrap/raw/branch/master/scripts/ceres | sudo tee /usr/share/debootstrap/scripts/`echo ${{ inputs.compat-distro-version }} | sed s/64$//`
- name: 1download
timeout-minutes: 120
run: |
sudo chown -R root:root local-repositories
sudo mv local-repositories ../woof-out_*/
cd ../woof-out_*
sudo -E ./1download
- name: Get cached kernel-kit output
uses: dawidd6/action-download-artifact@v6
with:
repo: vanilla-dpup/woof-CE
branch: vanilladpup-11.0.x
workflow: ${{ startsWith(inputs.kernel, 'debian-') && 'dpup-kernel.yml' || (startsWith(inputs.kernel, 'ubuntu-') && 'upup-kernel.yml' || 'kernel-kit.yml') }}
workflow_conclusion: success
name: kernel-kit-output-usrmerge-${{ inputs.kernel }}-${{ inputs.arch }}
path: output
- name: Move cached kernel-kit output
run: sudo mv output ../woof-out_*/kernel-kit/
- name: Get cached petbuild-output
uses: actions/cache@v4
with:
path: petbuild-output
key: petbuild-output-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-${{ github.sha }}
restore-keys: |
petbuild-output-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-
petbuild-output-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-
- name: Get cached petbuild-cache
uses: actions/cache@v4
with:
path: petbuild-cache
key: petbuild-cache-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-${{ github.sha }}
restore-keys: |
petbuild-cache-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-
petbuild-cache-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-
- name: Get cached petbuild-sources
uses: actions/cache@v4
with:
path: petbuild-sources
key: petbuild-sources-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-${{ github.sha }}
restore-keys: |
petbuild-sources-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-${{ inputs.variant }}-
petbuild-sources-${{ inputs.arch }}-${{ inputs.compat-distro }}-${{ inputs.compat-distro-version }}-
petbuild-sources-${{ inputs.arch }}-${{ inputs.compat-distro }}-
petbuild-sources-${{ inputs.arch }}-
petbuild-sources-
- name: 3builddistro
timeout-minutes: 180
run: |
sudo chown -R root:root petbuild-{sources,cache,output}
sudo mv petbuild-{sources,cache,output} ../woof-out_*/
cd ../woof-out_*
sudo -E ./3builddistro release
- name: Build woof-CE.tar.gz
run: |
cd ../buildenv
sudo mv ../woof-out_*/petbuild-sources ../woof-out_*/local-repositories woof-out_*/
sudo tar -c -I "gzip -9" -f $GITHUB_WORKSPACE/woof-CE.tar.gz woof-out_*
sudo mv woof-out_*/petbuild-sources woof-out_*/local-repositories $GITHUB_WORKSPACE/
- name: Move build output
run: |
for i in `ls ../woof-out_*/woof-output-*/*.img 2>/dev/null`; do sudo gzip -1 $i; done
for i in `ls ../woof-out_*/woof-output-*/*.{img.gz,iso} 2>/dev/null`; do sudo mv -f $i .; done
- name: Move cache
run: |
sudo mv ../woof-out_*/petbuild-{cache,output} $GITHUB_WORKSPACE/
sudo chown -R --reference ~ local-repositories petbuild-{sources,cache,output}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact }}
path: |
*.img.gz
woof-CE.tar.gz
retention-days: ${{ inputs.retention }}
compression-level: 0