Repository navigation
137 lines (120 loc) · 3.75 KB
/
Copy pathtoolchain.yml
File metadata and controls
137 lines (120 loc) · 3.75 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
name: toolchain
on:
workflow_dispatch:
inputs:
platforms:
description: 'Boards to rebuild and replace, space-separated (empty: build every toolchain not yet published)'
required: false
default: ''
type: string
env:
TAG_NAME: toolchain
jobs:
select:
name: Select platforms
runs-on: ubuntu-22.04
outputs:
platforms: ${{steps.select.outputs.platforms}}
steps:
- name: Checkout source
uses: actions/checkout@v4
# Naming platforms is how one toolchain gets rebuilt after a change to
# what it bundles (the uClibc compat archive, say): the full run below
# skips every toolchain already published, so it would never replace one.
- name: Select platforms
id: select
env:
PLATFORMS: ${{inputs.platforms}}
run: |
set -eu
ALL=$(sed -e 's/#.*//' <<'LIST'
# Sigmastar
ssc325_lite
ssc335_lite
ssc377_lite
ssc338q_lite
# Hisilicon
hi3516av100_lite
hi3516cv100_lite
hi3516cv200_lite
hi3516cv300_lite
hi3516cv500_lite
hi3516cv6xx_ultimate
# aarch64 musl toolchain, built from a decoupled toolchain-only
# config (see configs/hi3519dv500_toolchain_defconfig).
hi3519dv500_toolchain
hi3516ev200_lite
hi3519v101_lite
hi3520dv200_lite
hi3536cv100_lite
hi3536dv100_lite
# Goke
gk7102_lite
gk7205v200_lite
gk7205v500_lite
gk7206v100_lite
# Ingenic
t20_lite
t21_lite
t31_lite
t40_lite
# Allwinner
v851s_lite
# Fullhan
fh8852v100_lite
fh8852v200_lite
# Grainmedia
gm8136_lite
# Novatek
nt98562_lite
# Rockchip
rv1106_lite
rv1126_lite
# Xiongmai
xm510_lite
xm530_lite
LIST
)
SEL=${PLATFORMS:-$ALL}
# Only the curated list: two boards outside it can share one
# toolchain, and their jobs would race for the same release asset.
for p in ${SEL}; do
printf '%s\n' ${ALL} | grep -qx "${p}" || {
echo "::error::${p} is not a toolchain platform; pick from the list in this workflow"
exit 1
}
done
dup=$(printf '%s\n' ${SEL} | sort | uniq -d)
[ -z "${dup}" ] || { echo "::error::named twice: ${dup}"; exit 1; }
echo "platforms=$(printf '%s\n' ${SEL} | jq -Rnc '[inputs]')" >> ${GITHUB_OUTPUT}
toolchain:
name: Toolchain
needs: select
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
platform: ${{fromJSON(needs.select.outputs.platforms)}}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Build toolchain
env:
PLATFORMS: ${{inputs.platforms}}
run: |
GCC=$(make BOARD=${{matrix.platform}} toolname).tgz
URL=https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG_NAME}/${GCC}
echo ${URL}
# A named platform is rebuilt even when published: that is why it was named.
if [ -n "${PLATFORMS}" ] || ! wget -q --spider ${URL}; then
make BOARD=${{matrix.platform}} toolchain
SDK=$(find output/images -name *_sdk-buildroot.tar.gz)
mv ${SDK} ${GCC}
echo GCC=${GCC} >> ${GITHUB_ENV}
fi
- name: Upload toolchain
uses: softprops/action-gh-release@v2
with:
tag_name: ${{env.TAG_NAME}}
make_latest: false
files: ${{env.GCC}}