-
Notifications
You must be signed in to change notification settings - Fork 17
146 lines (126 loc) · 4.25 KB
/
build-boot.yml
File metadata and controls
146 lines (126 loc) · 4.25 KB
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
name: Build Bootloaders
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from'
default: 'main'
type: string
jobs:
build:
name: Build ${{ matrix.defconfig }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
defconfig:
- aarch64_qemu_boot
- bpi_r3_sd_boot
- bpi_r3_emmc_boot
- cn9130_crb_boot
- fireant_boot
- nanopi_r2s_boot
- rpi64_boot
env:
MAKEFLAGS: -j5
steps:
- name: Cleanup Build Folder
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Checkout infix repo
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}
clean: true
fetch-depth: 0
submodules: recursive
- name: Set Build Variables
id: vars
run: |
defconfig=${{ matrix.defconfig }}
version=$(awk -F'"' '/BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE=/ {print $2}' configs/${defconfig}_defconfig)
version=${version:-git}
filename=$(echo "${defconfig}" | tr '_' '-')
# TODO: Replace hardcoded rev with actual revision stepping
rev="latest"
archive="${filename}-${version}-${rev}.tar.gz"
dirname="${filename}-${version}-${rev}"
echo "defconfig=${defconfig}" >> $GITHUB_OUTPUT
echo "version=${version}" >> $GITHUB_OUTPUT
echo "rev=${rev}" >> $GITHUB_OUTPUT
echo "archive=${archive}" >> $GITHUB_OUTPUT
echo "dirname=${dirname}" >> $GITHUB_OUTPUT
echo "Building ${defconfig}_defconfig, version ${version}-${rev}, artifact ${archive} ..."
- name: Restore Cache of dl/
uses: actions/cache@v4
with:
path: dl/
key: dl-boot-${{ hashFiles('.git/modules/buildroot/HEAD', 'configs/*', 'package/*/*.hash') }}
restore-keys: |
dl-boot-
dl-
- name: Restore Cache of .ccache/
uses: actions/cache@v4
with:
path: .ccache/
key: ccache-boot-${{ matrix.defconfig }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
restore-keys: |
ccache-boot-${{ matrix.defconfig }}-
ccache-boot-
ccache-
- name: Configure ${{ matrix.defconfig }}_defconfig
run: |
make ${{ matrix.defconfig }}_defconfig
- name: Build ${{ matrix.defconfig }}_defconfig
run: |
echo "Building ${{ matrix.defconfig }}_defconfig ..."
make -j$((`getconf _NPROCESSORS_ONLN` / 2 + 2))
- name: Resulting size of build
run: |
printf "Size of output/images/: "
ls -l output/images/
- name: Prepare ${{ matrix.defconfig }} Artifact
run: |
cd output/
mv images ${{ steps.vars.outputs.dirname }}
tar cfz ${{ steps.vars.outputs.archive }} ${{ steps.vars.outputs.dirname }}/
- uses: actions/upload-artifact@v4
with:
path: output/${{ steps.vars.outputs.archive }}
name: artifact-${{ matrix.defconfig }}
publish:
name: Upload Bootloader Artifacts
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: "artifact-*"
merge-multiple: true
- name: Create checksums ...
run: |
for file in *.tar.gz; do
sha256sum $file > $file.sha256
done
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitName: true
omitBody: true
omitBodyDuringUpdate: true
prerelease: true
tag: "latest-boot"
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "*.tar.gz*"
- name: Summary
run: |
cat <<EOF >> $GITHUB_STEP_SUMMARY
# Bootloader Build Complete! :rocket:
For the public download links of these bootloader artifacts, please see:
<https://github.com/kernelkit/infix/releases/tag/latest-boot>
EOF