Skip to content

k230-u-boot-build

k230-u-boot-build #4

Workflow file for this run

name: k230-u-boot-build
on:
push:
tags:
- '*'
branches:
- '*'
pull_request:
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
env:
xuantie_toolchain: https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1698113812618
toolchain_file_name: Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.8.0-20231018.tar.gz
mainline_toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.02.02
mainline_toolchain_file_name: riscv64-glibc-ubuntu-22.04-gcc-nightly-2024.02.02-nightly.tar.gz
wget_alias: 'wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0'
ARCH: riscv
CROSS_COMPILE: riscv64-unknown-linux-gnu-
jobs:
build:
strategy:
fail-fast: false
matrix:
name: [gcc-13]
board: [canmv, evb]
runs-on: ubuntu-22.04
steps:
- name: Install software
run: |
sudo apt update && \
sudo apt install -y gdisk dosfstools g++-12-riscv64-linux-gnu build-essential \
libncurses-dev gawk flex bison openssl libssl-dev tree \
dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf device-tree-compiler
- name: Checkout uboot
uses: actions/checkout@v4
- name: uboot compile
run: |
mkdir output
if [[ ${{ matrix.name }} = "thead-gcc" ]]; then
${wget_alias} ${xuantie_toolchain}/${toolchain_file_name}
tar -xvf ${toolchain_file_name} -C /opt
export PATH="/opt/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.8.0/bin:$PATH"
else
${wget_alias} ${mainline_toolchain}/${mainline_toolchain_file_name}
tar -xvf ${mainline_toolchain_file_name} -C /opt
export PATH="/opt/riscv/bin:$PATH"
fi
${CROSS_COMPILE}gcc -v
# venv python for sm4
sudo apt install -y python3-pip python3-venv
python3 -m venv venv
source venv/bin/activate
pip install gmssl
pushd $PWD
make k230_${{ matrix.board }}_defconfig
make -j$(nproc)
find . -name "u-boot-spl-k230.bin" | xargs -I{} cp -av {} ${GITHUB_WORKSPACE}/output/u-boot-spl-k230_${{ matrix.board }}.bin
find . -name "fn_u-boot.img" | xargs -I{} cp -av {} ${GITHUB_WORKSPACE}/output/fn_u-boot_${{ matrix.board }}.img
popd
tree ${GITHUB_WORKSPACE}/output
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: k230-uboot-${{ matrix.board }}-${{ matrix.name }}
path: output/*.*
retention-days: 30
- name: 'Create release by tag'
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.name == 'gcc-13' }}
with:
files: output/*.*
token: ${{ secrets.GITHUB_TOKEN }}