-
-
Notifications
You must be signed in to change notification settings - Fork 74
251 lines (215 loc) 路 8.46 KB
/
ci.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: mt32-pi CI
on: [push, pull_request]
env:
toolchain-version: 11.3.rel1
python-version: 3.11
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.7.0
with:
python-version: ${{ env.python-version }}
- uses: psf/black@stable
with:
options: --check --diff --preview
src: scripts
- uses: isort/isort-action@master
with:
sortPaths: scripts
- uses: py-actions/flake8@v2
with:
path: scripts
- uses: ludeeus/action-shellcheck@master
with:
scandir: scripts
build:
runs-on: ubuntu-latest
name: build-${{ matrix.board }}
strategy:
fail-fast: false
matrix:
board: [pi2, pi3-64, pi4-64]
steps:
- uses: actions/checkout@v3
- name: Fetch submodules
run: make submodules
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ env.toolchain-version }}-${{ matrix.board }}
- name: Cache ARM toolchains
id: cache-toolchains
uses: actions/cache@v3
with:
path: |
~/arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-arm-none-eabi
~/arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-aarch64-none-elf
key: cache-arm-toolchains-${{ env.toolchain-version }}
- name: Install toolchains if not retrieved from cache
if: steps.cache-toolchains.outputs.cache-hit != 'true'
run: |
for triplet in arm-none-eabi aarch64-none-elf; do
wget -q https://developer.arm.com/-/media/Files/downloads/gnu/${{ env.toolchain-version }}/binrel/arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-${triplet}.tar.xz
tar -xf arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-${triplet}.tar.xz -C ~
rm arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-${triplet}.tar.xz
done
- name: Update PATH
run: |
mkdir ~/ccache_bin
for triplet in arm-none-eabi aarch64-none-elf; do
ln -s $(which ccache) ~/ccache_bin/${triplet}-gcc
ln -s $(which ccache) ~/ccache_bin/${triplet}-g++
echo "$HOME/ccache_bin:$HOME/arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-${triplet}/bin" >> $GITHUB_PATH
done
- name: Build
run: make -j BOARD=${{ matrix.board }}
- name: Upload built kernel
uses: actions/upload-artifact@v3
with:
name: kernels
path: kernel*.img
- name: Build (HDMI console)
run: make clean && make -j BOARD=${{ matrix.board }} HDMI_CONSOLE=1
- name: Upload built kernel
uses: actions/upload-artifact@v3
with:
name: kernels-hdmi
path: kernel*.img
package:
needs: build
runs-on: ubuntu-latest
env:
boot-home: external/circle-stdlib/libs/circle/boot
wlan-home: external/circle-stdlib/libs/circle/addon/wlan
steps:
- uses: actions/checkout@v3
- name: Fetch submodules
run: make submodules
- name: Cache boot files
id: cache-boot-files
uses: actions/cache@v3
with:
path: |
sdcard/armstub8-rpi4.bin
sdcard/bcm2711-rpi-4-b.dtb
sdcard/bcm2711-rpi-400.dtb
sdcard/bcm2711-rpi-cm4.dtb
sdcard/bootcode.bin
sdcard/COPYING.linux
sdcard/fixup_cd.dat
sdcard/fixup4cd.dat
sdcard/LICENCE.broadcom
sdcard/start_cd.elf
sdcard/start4cd.elf
key: cache-boot-files-${{ hashFiles(join(env.boot-home, '/Makefile')) }}
- name: Cache WLAN firmware
id: cache-wlan-firmware
uses: actions/cache@v3
with:
path: sdcard/firmware
key: cache-wlan-firmware-${{ hashFiles(join(env.wlan-home, '/firmware/Makefile')) }}
- name: Cache ARM toolchains
if: steps.cache-boot-files.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: |
~/arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-arm-none-eabi
~/arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-aarch64-none-elf
key: cache-arm-toolchains-${{ env.toolchain-version }}
- name: Update PATH
if: steps.cache-boot-files.outputs.cache-hit != 'true'
run: |
for triplet in arm-none-eabi aarch64-none-elf; do
echo "$HOME/arm-gnu-toolchain-${{ env.toolchain-version }}-x86_64-${triplet}/bin" >> $GITHUB_PATH
done
- name: Download boot files and build ARM stub if not retrieved from cache
if: steps.cache-boot-files.outputs.cache-hit != 'true'
run: |
make -C ${{ env.boot-home }} firmware armstub64
cp ${{ env.boot-home }}/armstub8-rpi4.bin \
${{ env.boot-home }}/bcm2711-rpi-4-b.dtb \
${{ env.boot-home }}/bcm2711-rpi-400.dtb \
${{ env.boot-home }}/bcm2711-rpi-cm4.dtb \
${{ env.boot-home }}/bootcode.bin \
${{ env.boot-home }}/COPYING.linux \
${{ env.boot-home }}/fixup_cd.dat \
${{ env.boot-home }}/fixup4cd.dat \
${{ env.boot-home }}/LICENCE.broadcom \
${{ env.boot-home }}/start_cd.elf \
${{ env.boot-home }}/start4cd.elf \
sdcard
- name: Download WLAN firmware if not retrieved from cache
if: steps.cache-wlan-firmware.outputs.cache-hit != 'true'
run: |
mkdir -p sdcard/firmware
make -C ${{ env.wlan-home }}/firmware
cp ${{ env.wlan-home }}/firmware/LICENCE.broadcom_bcm43xx \
${{ env.wlan-home }}/firmware/brcmfmac43430-sdio.bin \
${{ env.wlan-home }}/firmware/brcmfmac43430-sdio.txt \
${{ env.wlan-home }}/firmware/brcmfmac43436-sdio.bin \
${{ env.wlan-home }}/firmware/brcmfmac43436-sdio.txt \
${{ env.wlan-home }}/firmware/brcmfmac43436-sdio.clm_blob \
${{ env.wlan-home }}/firmware/brcmfmac43455-sdio.bin \
${{ env.wlan-home }}/firmware/brcmfmac43455-sdio.txt \
${{ env.wlan-home }}/firmware/brcmfmac43455-sdio.clm_blob \
${{ env.wlan-home }}/firmware/brcmfmac43456-sdio.bin \
${{ env.wlan-home }}/firmware/brcmfmac43456-sdio.txt \
${{ env.wlan-home }}/firmware/brcmfmac43456-sdio.clm_blob \
sdcard/firmware
- name: Cache GeneralUser GS SoundFont
id: cache-generaluser-gs
uses: actions/cache@v3
with:
path: GeneralUser GS v1.511
key: cache-generaluser-gs-1.511
- name: Download GeneralUser GS SoundFont if not retrieved from cache
if: steps.cache-generaluser-gs.outputs.cache-hit != 'true'
run: |
sudo pip install gdown
gdown -q https://drive.google.com/uc?id=1ypgJwuHqqXx-jeCXLRFqgBAEemJZnDrj
unzip "GeneralUser GS v1.511.zip"
- name: Retrieve built kernels
uses: actions/download-artifact@v3
with:
name: kernels
path: sdcard
- name: Add extra files to SD card directory
run: |
mkdir sdcard/docs
cp "GeneralUser GS v1.511/GeneralUser GS v1.511.sf2" sdcard/soundfonts
cp "GeneralUser GS v1.511/CHANGELOG.md" sdcard/docs/CHANGELOG.GeneralUserGS
cp "GeneralUser GS v1.511/LICENSE.txt" sdcard/docs/LICENSE.GeneralUserGS
cp LICENSE sdcard/docs
cp README.md sdcard/docs
- name: Upload SD card archive
uses: actions/upload-artifact@v3
with:
name: sdcard
path: sdcard
- name: Get version (git tag)
if: startsWith(github.ref, 'refs/tags/')
id: get_version
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- name: Create release package
if: startsWith(github.ref, 'refs/tags/')
run: cd sdcard; zip -r ../mt32-pi-${{ steps.get_version.outputs.version }}.zip *
- name: Release
uses: docker://antonyurchenko/git-release:latest
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "false"
PRE_RELEASE: "false"
CHANGELOG_FILE: "CHANGELOG.md"
ALLOW_EMPTY_CHANGELOG: "false"
with:
args: |
mt32-pi-*.zip
- name: Notify Discord servers of release
if: startsWith(github.ref, 'refs/tags/')
run: |
sudo pip3 install keepachangelog discord-webhook
.github/scripts/discord_notify.py ${{ secrets.MISTER_DISCORD_WEBHOOK }} ${{ steps.get_version.outputs.version }}
.github/scripts/discord_notify.py ${{ secrets.FPGAMING_DISCORD_WEBHOOK }} ${{ steps.get_version.outputs.version }}