Skip to content

Commit b1e4cf0

Browse files
committed
.github: nightly build of bootloaders
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent ebf4157 commit b1e4cf0

1 file changed

Lines changed: 134 additions & 0 deletions

File tree

.github/workflows/build-boot.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Build Bootloaders
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to build from'
8+
default: 'main'
9+
type: string
10+
push:
11+
branches:
12+
- images
13+
14+
jobs:
15+
build:
16+
name: Build ${{ matrix.defconfig }}
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
defconfig:
22+
- cn9130_crb_boot
23+
- aarch64_qemu_boot
24+
- rpi4_boot
25+
steps:
26+
- name: Cleanup Build Folder
27+
run: |
28+
ls -la ./
29+
rm -rf ./* || true
30+
rm -rf ./.??* || true
31+
ls -la ./
32+
33+
- name: Checkout infix repo
34+
uses: actions/checkout@v4
35+
with:
36+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}
37+
clean: true
38+
fetch-depth: 0
39+
submodules: recursive
40+
41+
- name: Set Build Variables
42+
id: vars
43+
run: |
44+
defconfig=${{ matrix.defconfig }}
45+
version=$(awk -F'"' '/BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE=/ {print $2}' configs/${defconfig}_defconfig)
46+
filename=$(echo "${defconfig}" | tr '_' '-')
47+
tgz="${filename}-${version}-1.tar.gz"
48+
49+
echo "defconfig=${defconfig}" >> $GITHUB_OUTPUT
50+
echo "version=${version}" >> $GITHUB_OUTPUT
51+
echo "tgz=${tgz}" >> $GITHUB_OUTPUT
52+
53+
echo "Building ${defconfig}_defconfig with version ${version}"
54+
55+
- name: Restore Cache of dl/
56+
uses: actions/cache@v4
57+
with:
58+
path: dl/
59+
key: dl-boot-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
60+
restore-keys: |
61+
dl-boot-
62+
dl-
63+
64+
- name: Restore Cache of .ccache/
65+
uses: actions/cache@v4
66+
with:
67+
path: .ccache/
68+
key: ccache-boot-${{ matrix.defconfig }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
69+
restore-keys: |
70+
ccache-boot-${{ matrix.defconfig }}-
71+
ccache-boot-
72+
ccache-
73+
74+
- name: Configure ${{ matrix.defconfig }}_defconfig
75+
run: |
76+
make ${{ matrix.defconfig }}_defconfig
77+
78+
- name: Build ${{ matrix.defconfig }}_defconfig
79+
run: |
80+
echo "Building ${{ matrix.defconfig }}_defconfig ..."
81+
make -j$((`getconf _NPROCESSORS_ONLN` / 2 + 2))
82+
83+
- name: Resulting size of build
84+
run: |
85+
printf "Size of output/images/: "
86+
ls -l output/images/
87+
88+
- name: Prepare ${{ matrix.defconfig }} Artifact
89+
run: |
90+
cd output/
91+
tar cfz ${{ steps.vars.outputs.tgz }} images/
92+
93+
- uses: actions/upload-artifact@v4
94+
with:
95+
path: output/${{ steps.vars.outputs.tgz }}
96+
name: artifact-${{ matrix.defconfig }}
97+
98+
publish:
99+
name: Upload Bootloader Artifacts
100+
runs-on: ubuntu-latest
101+
needs: build
102+
permissions:
103+
contents: write
104+
steps:
105+
- uses: actions/download-artifact@v4
106+
with:
107+
pattern: "artifact-*"
108+
merge-multiple: true
109+
110+
- name: Create checksums ...
111+
run: |
112+
for file in *.tar.gz; do
113+
sha256sum $file > $file.sha256
114+
done
115+
116+
- uses: ncipollo/release-action@v1
117+
with:
118+
allowUpdates: true
119+
omitName: true
120+
omitBody: true
121+
omitBodyDuringUpdate: true
122+
prerelease: true
123+
tag: "latest-boot"
124+
token: ${{ secrets.GITHUB_TOKEN }}
125+
artifacts: "*.tar.gz*"
126+
127+
- name: Summary
128+
run: |
129+
cat <<EOF >> $GITHUB_STEP_SUMMARY
130+
# Bootloader Build Complete! :rocket:
131+
132+
For the public download links of these bootloader artifacts, please see:
133+
<https://github.com/kernelkit/infix/releases/tag/latest-boot>
134+
EOF

0 commit comments

Comments
 (0)