-
Notifications
You must be signed in to change notification settings - Fork 34
154 lines (150 loc) · 4.87 KB
/
buildroot.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
name: build-all
on:
workflow_dispatch:
push:
branches: [ main ]
paths-ignore:
- '.github/**'
tags:
- "v*.*.*"
pull_request:
branches: [ main ]
paths-ignore:
- '.github/**'
jobs:
buildroot:
strategy:
fail-fast: true
matrix:
target: [ pine64_ox64_defconfig, pine64_ox64_full_defconfig ]
runs-on: ubuntu-22.04
steps:
- name: install dependencies
run: |
sudo apt-get install -y make gcc g++ unzip git bc python3 device-tree-compiler mtd-utils xz-utils
- name: Checkout Buildroot sources
uses: actions/checkout@v3
with:
repository: buildroot/buildroot
ref: 2022.11.1
path: buildroot
- name: Checkout OpenBouffalo Buildroot
uses: actions/checkout@v3
with:
path: buildroot_bouffalo
- name: buildroot ccache
id: br-ccache
uses: actions/cache@v3
env:
cache-name: br-ccache
with:
path: /home/runner/.buildroot-ccache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.target }}
- name: buildroot download cache
uses: actions/cache@v3
env:
cache-name: cache-download-files
with:
path: ${{ github.workspace }}/buildroot/dl/
key: ${{ runner.os }}-build-${{ env.cache-name }}-downloads
- name: Build
run: |
export BR_BOUFFALO_OVERLAY_PATH=$(pwd)/buildroot_bouffalo
cd buildroot
make BR2_EXTERNAL=$BR_BOUFFALO_OVERLAY_PATH ${{ matrix.target }}
make
make sdk
make ccache-stats
- name: Pack
run: |
cd ${{ github.workspace }}/buildroot/output/images/
ls -lah
if [ -f sdcard.img ]; then
xz -z sdcard.img
mv sdcard.img.xz sdcard-${{ matrix.target }}.img.xz
fi
if [ -f Image ]; then
lz4 -9 -f Image Image-${{ matrix.target }}.lz4
fi
echo "PACKAGE=${{ github.workspace }}/buildroot/output/images/sdcard-${{ matrix.target }}.img.xz" >> $GITHUB_ENV
echo "KERNEL=${{ github.workspace }}/buildroot/output/images/Image-${{ matrix.target }}.lz4" >> $GITHUB_ENV
echo "DTB=${{ github.workspace }}/buildroot/output/images/bl808-*.dtb" >> $GITHUB_ENV
echo "OPENSBI=${{ github.workspace }}/buildroot/output/images/fw_jump.bin" >> $GITHUB_ENV
echo "LOWLOAD=${{ github.workspace }}/buildroot/output/images/*_lowload_bl808_*.bin" >> $GITHUB_ENV
echo "WHOLEBINOX=${{ github.workspace }}/buildroot/output/images/bl808-firmware.bin" >> $GITHUB_ENV
echo "BRSDK=${{ github.workspace }}/buildroot/output/images/riscv*.tar.gz" >> $GITHUB_ENV
- name: Upload package
uses: actions/upload-artifact@master
with:
name: build artifacts
path: |
${{env.PACKAGE}}
${{env.KERNEL}}
${{env.DTB}}
${{env.OPENSBI}}
${{env.LOWLOAD}}
${{env.WHOLEBINOX}}
- name: Upload sdk
if: matrix.target == 'pine64_ox64_full_defconfig'
uses: actions/upload-artifact@master
with:
name: buildroot-sdk
path: |
${{env.BRSDK}}
createimages:
strategy:
fail-fast: true
matrix:
target: [ pine64_ox64_defconfig, pine64_ox64_full_defconfig ]
runs-on: ubuntu-22.04
needs: [buildroot]
steps:
- name: install dependencies
run: |
sudo apt-get install -y python3
- name: Checkout OpenBouffalo Buildroot
uses: actions/checkout@v3
with:
path: buildroot_bouffalo
- name: Download build files
uses: actions/download-artifact@v3
with:
name: build artifacts
path: ${{ github.workspace }}/build
- name: Create images
run: |
cd ${{ github.workspace }}/build
ls -lah
mv Image-${{ matrix.target }}.lz4 Image.lz4
mkdir firmware
cp *_lowload_bl808_*.bin firmware/
cp bl808-firmware.bin firmware/
cp sdcard-${{ matrix.target }}.img.xz firmware/
tar -czvf bl808-linux-${{ matrix.target }}.tar.gz firmware
echo "FIRMWARE=${{ github.workspace }}/build/bl808-linux-${{ matrix.target }}.tar.gz" >> $GITHUB_ENV
- name: Upload Firmware
uses: actions/upload-artifact@master
with:
name: linux-buildroot-${{ matrix.target }}
path: |
${{env.FIRMWARE}}
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-22.04
needs: [createimages]
permissions: write-all
steps:
- name: download firmware
uses: actions/download-artifact@v3
- name: Create images
run: |
ls -lah
ls -lah linux-buildroot-*/*.tar.gz
ls -lah buildroot-sdk/*.tar.gz
- name: publish artifacts
uses: softprops/action-gh-release@v1
with:
append_body: true
files: |
linux-buildroot-*/*.tar.gz
buildroot-sdk/*.tar.gz