-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (126 loc) · 5.18 KB
/
build-all.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
name: build-all
on: push
# on:
# workflow_dispatch:
# inputs:
# git-address:
# description: 'git-address'
# required: true
# default: 'https://github.com/buildroot/buildroot.git'
# branches-tags:
# description: 'branches-tags'
# required: true
# # default: '2018.08.2'
# default: '2023.05.x'
# board:
# description: 'board'
# required: true
# default: 'raspberrypi4'
# custom-config:
# description: 'custom-config'
# required: false
# default: 'raspberrypi4_defconfig'
# build-with:
# description: 'build-with'
# required: false
# default: ''
env:
# BUILDROOT_GIT_REPO: ${{ github.event.inputs.git-address }}
BUILDROOT_GIT_REPO: 'https://github.com/buildroot/buildroot.git'
BUILDROOT_TAG: '2023.05.x'
# BUILDROOT_TAG: ${{ github.event.inputs.branches-tags }}
BUILDROOT_BOARD: 'raspberrypi4'
BUILDROOT_DEFCONFIG: 'raspberrypi4_defconfig'
jobs:
build:
# runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Dump event
run: cat "$GITHUB_EVENT_PATH"
- name: Cancel previous runs in progress
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
# Needed for apt-get build-dep erlang
# - name: Enable apt-src sources
# run: |
# sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list
# sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list.d/microsoft-prod.list
# sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
- name: Check out source
uses: actions/checkout@v3
- name: Restore buildroot from cache
uses: actions/cache@v3
with:
path: |
/opt/buildroot
key: buildroot-${{ env.BUILDROOT_TAG }}
restore-keys: |
buildroot-${{ env.BUILDROOT_TAG }}
- name: Get buildroot source
run: |
[ -d /opt/buildroot ] || git clone $BUILDROOT_GIT_REPO /opt/buildroot
- name: Install build deps
run: |
sudo apt-get update
# sudo apt-get upgrade
# sudo apt-get install -y make gcc g++ unzip git device-tree-compiler mtd-utils
# https://buildroot.org/downloads/manual/manual.html#requirement
sudo apt-get install -y sed make binutils build-essential diffutils gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync bc findutils wget git python2
# sudo apt-get install -y ncurses-base ncurses-bin libncurses5-dev dialog
# echo "--- erlang"
# sudo apt-get build-dep erlang
- name: Bulid
run: |
cd /opt/buildroot
git checkout $BUILDROOT_TAG
git pull origin $BUILDROOT_TAG
# if [ "x$BUILDROOT_CUSTOM_CONFIG" == 'x' ]; then cp -f ${{ github.workspace }}/configs/${{env.BUILDROOT_CUSTOM_CONFIG}} configs/; fi
# make $BUILDROOT_DEFCONFIG
make BR2_EXTERNAL="${{ github.workspace }}/buildroot" $BUILDROOT_DEFCONFIG
# make O=/opt/buildroot_output BR2_EXTERNAL="${{ github.workspace }}/buildroot" $BUILDROOT_DEFCONFIG
make
# - name: Copy firmware
# run: |
# mkdir /opt/firmware
# ls -l /opt/buildroot/output/images
# cp -r -v /opt/buildroot/output/images /opt/firmware
# -rwxr-xr-x+ 1 runner docker 51543 Aug 24 02:41 bcm2711-rpi-4-b.dtb
# -rw-rw-rw-+ 1 runner docker 33554432 Aug 24 03:14 boot.vfat
# -rw-rw-rw-+ 1 runner docker 125829120 Aug 24 03:14 rootfs.ext2
# lrwxrwxrwx 1 runner docker 11 Aug 24 03:14 rootfs.ext4 -> rootfs.ext2
# drwxr-xr-x+ 3 runner docker 4096 Aug 24 02:06 rpi-firmware
# -rw-rw-rw-+ 1 runner docker 159384064 Aug 24 03:14 sdcard.img
# -rw-r--r--+ 1 runner docker 6762552 Aug 24 02:41 zImage
- name: Create build tag
run: |
BUILD_TAG="${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"
echo "${BUILD_TAG}"
echo "BUILD_TAG=build-${BUILD_TAG}" >> $GITHUB_ENV
# Releases require a tag
- name: Tag build
run: |
git tag $BUILD_TAG
git push origin $BUILD_TAG
- name: Release
uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ env.BUILD_TAG }}
files: /opt/buildroot/output/images/sdcard.img
# https://github.com/marketplace/actions/create-release
# - name : Upload buildroot-${{env.BUILDROOT_TAG}}-${{env.BUILDROOT_BOARD}}
# uses: actions/upload-artifact@v3
# with:
# name: buildroot-${{env.BUILDROOT_TAG}}-${{env.BUILDROOT_BOARD}}
# path: /opt/firmware
# - name: Create release firmware
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./bin/azblogfilter.linux-amd64.tar.gz
# asset_name: azblogfilter.linux-amd64.tar.gz
# asset_content_type: application/gzip