-
-
Notifications
You must be signed in to change notification settings - Fork 248
246 lines (204 loc) · 8.38 KB
/
autobuild.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build Arc Dev
on:
workflow_dispatch:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
swap-storage: false
# Install Dependencies
- name: Install Dependencies
run: |
git config --global user.email "[email protected]"
git config --global user.name "AuxXxilium"
sudo timedatectl set-timezone "Europe/Berlin"
sudo apt update
sudo apt install -y jq gawk cpio gettext libelf-dev qemu-utils busybox dialog curl sed
sudo pip install bs4
sudo snap install yq
df -h
# calculates the version number and push
- name: Calculate Version
run: |
# Calculate Version
VERSION="`date +'%y.%m'`.dev"
echo "Version: ${VERSION}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
# Get extractor, LKM, Addons, Modules, Theme and Configs
- name: Get extractor, LKM, Addons, Modules, Theme and Configs
run: |
. scripts/func.sh
getLKMs "files/p3/lkms"
echo "LKMTAG=${TAG}" >> $GITHUB_ENV
getAddons "files/p3/addons"
echo "ADDONSTAG=${TAG}" >> $GITHUB_ENV
getModules "files/p3/modules"
echo "MODULESTAG=${TAG}" >> $GITHUB_ENV
getConfigs "files/p3/configs"
echo "CONFIGSTAG=${TAG}" >> $GITHUB_ENV
getPatches "files/p3/patches"
echo "PATCHESTAG=${TAG}" >> $GITHUB_ENV
getCustom "files/p3/custom"
echo "CUSTOMTAG=${TAG}" >> $GITHUB_ENV
getTheme "files/p1/boot/grub"
echo "THEMETAG=${TAG}" >> $GITHUB_ENV
getBuildrootx "latest" "brx"
echo "BRX_VERSION=${TAG}" >> $GITHUB_ENV
getBuildroots "latest" "brs"
echo "BRS_VERSION=${TAG}" >> $GITHUB_ENV
getOffline "files/p3/configs"
echo "BUILD_TIME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
echo "OK"
# Build incremental
- name: Build Image S
run: |
. scripts/func.sh
if [ -n "${VERSION}" ]; then
# Modify Source File
echo "${VERSION}" >VERSION
echo "${VERSION}" >files/p1/ARC-VERSION
echo "stable" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
fi
echo "Create Arc Image"
IMAGE_FILE="arc.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brs/bzImage-arc" ] || [ ! -f "brs/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brs/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brs/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
echo "Image Converter"
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc.vmdk
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc.ova"
# Zip update and generate checksum
zip -9j update.zip "files/p3/bzImage-arc" "files/p3/initrd-arc" "files/p1/ARC-VERSION" "files/p1/boot/grub/grub.cfg"
sha256sum update.zip >checksum.sha256
# Build incremental
- name: Build Image X
run: |
. scripts/func.sh
if [ -n "${VERSION}" ]; then
# Modify Source File
echo "${VERSION}" >VERSION
echo "${VERSION}" >files/p1/ARC-VERSION
echo "next" >files/p1/ARC-BRANCH
sed 's/^ARC_VERSION=.*/ARC_VERSION="'${VERSION}'"/' -i files/initrd/opt/arc/include/consts.sh
fi
echo "Create Arc Image"
IMAGE_FILE="arc-next.img"
gzip -dc "files/initrd/opt/arc/grub.img.gz" >"${IMAGE_FILE}"
fdisk -l "${IMAGE_FILE}"
LOOPX=$(sudo losetup -f)
sudo losetup -P "${LOOPX}" "${IMAGE_FILE}"
echo "Mounting Image File"
mkdir -p "/tmp/p1"
mkdir -p "/tmp/p3"
sudo mount ${LOOPX}p1 "/tmp/p1"
sudo mount ${LOOPX}p3 "/tmp/p3"
[ ! -f "brx/bzImage-arc" ] || [ ! -f "brx/initrd-arc" ] && return 1
echo "Repack initrd"
cp -f "brx/bzImage-arc" "files/p3/bzImage-arc"
repackInitrd "brx/initrd-arc" "files/initrd" "files/p3/initrd-arc"
echo "Copying files"
sudo cp -Rf "files/p1/"* "/tmp/p1"
sudo cp -Rf "files/p3/"* "/tmp/p3"
sync
echo "Unmount image file"
sudo umount "/tmp/p1"
sudo umount "/tmp/p3"
rmdir "/tmp/p1"
rmdir "/tmp/p3"
sudo losetup --detach ${LOOPX}
echo "Image Converter"
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic arc-next-dyn.vmdk
qemu-img convert ${IMAGE_FILE} -O vmdk -o adapter_type=lsilogic,subformat=monolithicFlat arc-next.vmdk
qemu-img convert ${IMAGE_FILE} -O vhdx -o subformat=dynamic arc-next.vhdx
echo "Create Arc ova"
convertova "${IMAGE_FILE}" "arc-next.ova"
# Zip update and generate checksum
zip -9j update-next.zip "files/p3/bzImage-arc" "files/p3/initrd-arc" "files/p1/ARC-VERSION" "files/p1/boot/grub/grub.cfg"
sha256sum update-next.zip >checksum-next.sha256
# Zip image and generate checksum
- name: Pack
run: |
if [ -n "${{ env.VERSION }}" ]; then
# XBase
zip -9 "arc-${{ env.VERSION }}-next.img.zip" arc-next.img
zip -9 "arc-${{ env.VERSION }}-next.vmdk-dyn.zip" arc-next-dyn.vmdk
zip -9 "arc-${{ env.VERSION }}-next.vmdk-flat.zip" arc-next.vmdk arc-next-flat.vmdk
zip -9 "arc-${{ env.VERSION }}-next.vhdx.zip" arc-next.vhdx
zip -9 "arc-${{ env.VERSION }}-next.ova.zip" arc-next.ova
# SBase
zip -9 "arc-${{ env.VERSION }}.img.zip" arc.img
zip -9 "arc-${{ env.VERSION }}.vmdk-dyn.zip" arc-dyn.vmdk
zip -9 "arc-${{ env.VERSION }}.vmdk-flat.zip" arc.vmdk arc-flat.vmdk
zip -9 "arc-${{ env.VERSION }}.ova.zip" arc.ova
fi
echo "24.01.01" >check.update
# Publish a release if is a tag
- name: Release
if: success() && env.VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
prerelease: true
makeLatest: false
allowUpdates: true
body: |
### Information:
Notice: Development Build
- Version:
- arc: Stable Buildroot System (Less Hardware supported / faster Boot)
- arc-next: Latest Buildroot System (More Hardware supported (still in testing))
- Full Changelog and Arc Patch (Decryption Key) are available in my Discord.
### Versions:
Addons: ${{ env.ADDONSTAG }}
Configs: ${{ env.CONFIGSTAG }}
Modules: ${{ env.MODULESTAG }}
Patches: ${{ env.PATCHESTAG }}
Custom: ${{ env.CUSTOMTAG }}
Theme: ${{ env.THEMETAG }}
LKM: ${{ env.LKMTAG }}
Buildroot: ${{ env.BRS_VERSION }} | Buildroot Next: ${{ env.BRX_VERSION }}
Release: ${{ env.BUILD_TIME }}
artifacts: |
arc-*.zip
update.zip
update-next.zip
checksum.sha256
checksum-next.sha256
check.update