-
Notifications
You must be signed in to change notification settings - Fork 17
97 lines (83 loc) · 2.72 KB
/
build-release.yml
File metadata and controls
97 lines (83 loc) · 2.72 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
# Needed for make pkg-stats
# sudo apt install python3-aiohttp
---
name: Build Release
on:
workflow_call:
inputs:
version:
required: true
type: string
use_cache:
required: false
type: boolean
default: true
jobs:
build:
name: Build Infix ${{ inputs.version }} [${{ matrix.target }}]
runs-on: [self-hosted, release]
strategy:
matrix:
target: [aarch64, arm, x86_64]
fail-fast: false
steps:
- uses: actions/checkout@v6
with:
clean: true
submodules: recursive
- uses: kernelkit/actions/podman-cleanup@v1
- name: Set Release Variables
id: vars
run: |
ver=${{ inputs.version }}
echo "ver=${ver}" >> $GITHUB_OUTPUT
fver=${ver#v}
target=${{ matrix.target }}-${fver}
echo "dir=infix-$target" >> $GITHUB_OUTPUT
echo "tgz=infix-$target.tar.gz" >> $GITHUB_OUTPUT
- uses: kernelkit/actions/cache-restore@v1
with:
target: ${{ matrix.target }}
enabled: ${{ inputs.use_cache }}
- name: Configure & Build
env:
INFIX_RELEASE: ${{ steps.vars.outputs.ver }}
run: |
target=${{ matrix.target }}_defconfig
echo "Building $target ..."
make $target
make
- name: Generate SBOM from Build
run: |
# Generate manifest files in CSV format for CycloneDX
make legal-info
# Generate cpe.json for CycloneDX
make -s show-info > output/cpe.json
# Generate pkg-stats.{json,html} for humans
make pkg-stats
- name: Build test specification
run: |
make test-spec
- name: Prepare Artifacts
run: |
cd output/
# Collect relevant files for SBOM and CPE info. for more info, see:
# https://github.com/CycloneDX/cyclonedx-buildroot
mkdir images/sbom
mv pkg-stats.* images/sbom/
mv cpe.json images/sbom/
mv legal-info/*.csv images/sbom/
# Remove rootfs.squashfs from release (can be extracted from rootfs.itb)
# Saves ~131MB per architecture. See issue #858
rm -f images/rootfs.squashfs
mv images ${{ steps.vars.outputs.dir }}
ln -s ${{ steps.vars.outputs.dir }} images
tar cfz ${{ steps.vars.outputs.tgz }} ${{ steps.vars.outputs.dir }}
- uses: actions/upload-artifact@v7
with:
name: artifact-${{ matrix.target }}
path: output/*.tar.gz
- uses: actions/upload-artifact@v7
with:
name: artifact-disk-image-${{ matrix.target }}
path: output/images/*.qcow2