-
Notifications
You must be signed in to change notification settings - Fork 30
88 lines (77 loc) · 2.33 KB
/
build.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
name: CI
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'info'
type: choice
options:
- off
- error
- warn
- info
- debug
- trace
bmcd_version:
description: 'BMC daemon version'
required: false
type: string
pull_request:
branches: ["master"]
push:
branches:
- '*'
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
env:
RUST_LOG: ${{ inputs.logLevel }}
steps:
- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@v1
with:
remove-android: 'true'
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: get version
run: echo "BUILD_VERSION=`git describe --tags`" >> $GITHUB_ENV
- name: conditional bmcd version injection
if: inputs.bmcd_version != ''
run: |
sed -ir 's#^BMCD_VERSION.*#BMCD_VERSION=${{ inputs.bmcd_version }}#g' ${{ github.workspace }}/tp2bmc/package/bmcd/bmcd.mk
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v4
with:
context: .
tags: buildroot_local:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
- name: build firmware
uses: addnab/docker-run-action@v3
with:
image: buildroot_local:latest
options: -v ${{ github.workspace }}:/work
run: |
/work/setup_build.sh
cd /work/buildroot
make BR2_EXTERNAL=../tp2bmc tp2bmc_defconfig
FORCE_UNSAFE_CONFIGURE=1 make
- name: stamp images
run: |
mkdir artifacts
sudo mv buildroot/output/images/tp2-factory-sdcard.img artifacts/tp2-factory-sdcard-${{ env.BUILD_VERSION }}.img
sudo mv buildroot/output/images/tp2-bmc-firmware-sdcard.img artifacts/tp2-firmware-sdcard-${{ env.BUILD_VERSION }}.img
sudo mv buildroot/output/images/rootfs.erofs artifacts/tp2-ota-${{ env.BUILD_VERSION }}.tpu
- name: archive artifacts
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: tp2-${{ env.BUILD_VERSION }}
path: artifacts/*