mirror of
https://github.com/dwhinham/mt32-pi.git
synced 2026-07-08 17:56:50 +00:00
An I²C-related issue has been introduced by updating to the March 24th version of start_cd.elf/fixup_cd.dat. Revert to the January 20th version until this is investigated and fixed.
244 lines
8.3 KiB
YAML
244 lines
8.3 KiB
YAML
name: mt32-pi CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
env:
|
|
toolchain-version: 10.3-2021.07
|
|
python-version: 3.6
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4.0.0
|
|
with:
|
|
python-version: ${{ env.python-version }}
|
|
|
|
- uses: psf/black@stable
|
|
with:
|
|
options: --check --diff --experimental-string-processing
|
|
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
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Cache ARM toolchains
|
|
id: cache-toolchains
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/gcc-arm-${{ env.toolchain-version }}-x86_64-arm-none-eabi
|
|
~/gcc-arm-${{ 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-a/${{ env.toolchain-version }}/binrel/gcc-arm-${{ env.toolchain-version }}-x86_64-${triplet}.tar.xz
|
|
tar -xf gcc-arm-${{ env.toolchain-version }}-x86_64-${triplet}.tar.xz -C ~
|
|
rm gcc-arm-${{ env.toolchain-version }}-x86_64-${triplet}.tar.xz
|
|
done
|
|
|
|
- name: Update PATH
|
|
run: |
|
|
for triplet in arm-none-eabi aarch64-none-elf; do
|
|
echo "$HOME/gcc-arm-${{ 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
|
|
with:
|
|
submodules: recursive
|
|
|
|
# - 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: |
|
|
~/gcc-arm-${{ env.toolchain-version }}-x86_64-arm-none-eabi
|
|
~/gcc-arm-${{ 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/gcc-arm-${{ 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'
|
|
# Temporarily patch boot firmware version
|
|
run: |
|
|
patch -N -p1 --no-backup-if-mismatch -r - -d external/circle-stdlib/libs/circle < patches/circle-44.5-revert-firmware.patch
|
|
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 }}
|