forked from puppylinux-woof-CE/woof-CE
-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (187 loc) · 7.8 KB
/
fossa64.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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: fossa64
on:
push:
branches:
- ci
- testing
paths:
- 'woof-distro/x86_64/ubuntu/focal64/**'
- 'kernel-kit/**'
- 'merge2out'
- '!**/README*'
pull_request:
branches:
- testing
paths:
- 'woof-distro/x86_64/ubuntu/focal64/**'
- 'kernel-kit/**'
- 'merge2out'
- '!**/README*'
schedule:
- cron: '0 0 * * 4'
workflow_dispatch:
branches:
- ci
- testing
inputs:
version:
description: 'Version number'
required: true
default: '9.5'
suffix:
description: 'Release name suffix, with leading -'
required: false
default: '-prepreprealpha1'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create cache directories
run: |
mkdir -p local-repositories petbuild-sources petbuild-cache petbuild-output kernel-kit-output
ln -s `pwd`/local-repositories ../local-repositories
- name: Get cached local-repositories
uses: actions/cache@v2
with:
path: local-repositories
key: ${{ github.workflow }}-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
- name: merge2out
run: |
(echo 3; echo 3; echo 2; echo; echo) | sudo -E ./merge2out
- name: Set version
if: github.event_name == 'workflow_dispatch'
run: sudo sed -i s/^DISTRO_VERSION=.*/DISTRO_VERSION=${{ github.event.inputs.version }}/ ../woof-out_x86_64_x86_64_ubuntu_focal64/DISTRO_SPECS
- name: Set compression algorithm
if: github.event_name != 'workflow_dispatch'
run: |
echo | sudo tee -a ../woof-out_x86_64_x86_64_ubuntu_focal64/_00build.conf
echo 'SFSCOMP="-comp lzo -Xalgorithm lzo1x_1"' | sudo tee -a ../woof-out_x86_64_x86_64_ubuntu_focal64/_00build.conf
- name: 0setup
run: |
cd ../woof-out_x86_64_x86_64_ubuntu_focal64
sudo -E ./0setup
- name: 1download
run: |
cd ../woof-out_x86_64_x86_64_ubuntu_focal64
sudo -E ./1download
- name: Get cached kernel-kit output
if: github.event_name != 'workflow_dispatch'
id: get_kernel_kit_output_cache
uses: actions/cache@v2
with:
path: kernel-kit-output
key: ${{ github.workflow }}-kernel-kit-output-${{ hashFiles('kernel-kit/**') }}
- name: Move cached kernel-kit output
run: sudo mv kernel-kit-output ../woof-out_x86_64_x86_64_ubuntu_focal64/kernel-kit/output
- name: Install kernel-kit dependencies
if: steps.get_kernel_kit_output_cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends ccache libelf-dev libssl-dev
ccache --set-config=hash_dir=false --set-config=max_size=2.0G
- name: Get cached ~/.ccache
if: github.event_name != 'workflow_dispatch' && steps.get_kernel_kit_output_cache.outputs.cache-hit != 'true'
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ github.workflow }}-ccache-${{ hashFiles('kernel-kit/**') }}
- name: kernel-kit
if: steps.get_kernel_kit_output_cache.outputs.cache-hit != 'true'
run: |
cd ../woof-out_x86_64_x86_64_ubuntu_focal64/kernel-kit
sudo cp -f fossa64-build.conf build.conf
sudo -E ./build.sh
- name: 2createpackages
run: |
cd ../woof-out_x86_64_x86_64_ubuntu_focal64
echo | sudo -E ./2createpackages
- name: Get cached petbuild-sources
uses: actions/cache@v2
with:
path: petbuild-sources
key: ${{ github.workflow }}-petbuild-sources-${{ github.sha }}
restore-keys: |
${{ github.workflow }}-petbuild-sources-
- name: Get cached petbuild-cache
if: github.event_name != 'workflow_dispatch'
uses: actions/cache@v2
with:
path: petbuild-cache
key: ${{ github.workflow }}-petbuild-cache-${{ github.sha }}
restore-keys: |
${{ github.workflow }}-petbuild-cache-
- name: Get cached petbuild-output
if: github.event_name != 'workflow_dispatch'
uses: actions/cache@v2
with:
path: petbuild-output
key: ${{ github.workflow }}-petbuild-output-${{ github.sha }}
restore-keys: |
${{ github.workflow }}-petbuild-output-
- name: Install cdrtools
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
run: |
sudo chown -R root:root petbuild-output
sudo mv petbuild-{sources,cache,output} ../woof-out_x86_64_x86_64_ubuntu_focal64/
cd ../woof-out_x86_64_x86_64_ubuntu_focal64
sudo -E HOME=/root ./3builddistro
- name: Create Release
if: github.event_name == 'workflow_dispatch'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: fossa64-${{ github.event.inputs.version }}${{ github.event.inputs.suffix }}
release_name: fossa64-${{ github.event.inputs.version }}${{ github.event.inputs.suffix }}
draft: false
prerelease: true
- name: Upload ISO
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../woof-out_x86_64_x86_64_ubuntu_focal64/woof-output-fossapup64-${{ github.event.inputs.version }}/fossapup64-${{ github.event.inputs.version }}.iso
asset_name: fossapup64-${{ github.event.inputs.version }}.iso
asset_content_type: application/octet-stream
- name: Upload devx
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../woof-out_x86_64_x86_64_ubuntu_focal64/woof-output-fossapup64-${{ github.event.inputs.version }}/devx_fossapup64_${{ github.event.inputs.version }}.sfs
asset_name: devx_fossapup64_${{ github.event.inputs.version }}.sfs
asset_content_type: application/octet-stream
- name: Upload kernel sources
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../woof-out_x86_64_x86_64_ubuntu_focal64/kernel-kit/output/kernel_sources-5.4-fossa64.sfs
asset_name: kernel_sources-5.4-fossa64.sfs
asset_content_type: application/octet-stream
- name: Move cached directories
run: |
sudo mv ../woof-out_x86_64_x86_64_ubuntu_focal64/petbuild-{sources,cache,output} .
sudo mv ../woof-out_x86_64_x86_64_ubuntu_focal64/kernel-kit/output kernel-kit-output