Skip to content

HSLink Pro project 2.3.0 #1

HSLink Pro project 2.3.0

HSLink Pro project 2.3.0 #1

name: HSLinkPro Pipeline
on:
push:
paths:
- '.github/workflows/HPM-build.yml'
- 'projects/HSLink-Pro/**'
tags:
- 'HSLinkPro*'
pull_request:
paths:
- '.github/workflows/HPM-build.yml'
- 'projects/HSLink-Pro/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: gregdavill/setup-riscv-gnu-toolchain@v2.0
- name: Install HPM SDK
run: |
cd ~
git clone https://github.com/hpmicro/hpm_sdk.git --recursive
- name: Create Python Venv
run: |
python3 -m venv ~/HPM_PYTHON
source ~/HPM_PYTHON/bin/activate
pip install pyyaml jinja2
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Build bootloader
run: |
cd projects/HSLink-Pro/bootloader
export HPM_SDK_BASE=~/hpm_sdk
export GNURISCV_TOOLCHAIN_PATH=/home/runner/work/_temp/.setup-riscv-gnu-toolchain
export HPM_SDK_TOOLCHAIN_VARIANT=gcc
export PYTHON_EXECUTABLE=~/HPM_PYTHON/bin/python3
cmake -GNinja -DBOARD=hpm5301evklite -DHPM_BUILD_TYPE=flash_xip -DCMAKE_BUILD_TYPE=release -Dpython_exec="~/HPM_PYTHON/bin/python3" -DCUSTOM_TARGET_TRIPLET=riscv-none-elf -DRV_ARCH="rv32imac_zicsr_zifencei" . -B=./build
cmake --build ./build
- name: Build APP
run: |
cd projects/HSLink-Pro/src
export HPM_SDK_BASE=~/hpm_sdk
export GNURISCV_TOOLCHAIN_PATH=/home/runner/work/_temp/.setup-riscv-gnu-toolchain
export HPM_SDK_TOOLCHAIN_VARIANT=gcc
export PYTHON_EXECUTABLE=~/HPM_PYTHON/bin/python3
cmake -GNinja -DBOARD=hpm5301evklite -DHPM_BUILD_TYPE=flash_uf2 -DCMAKE_BUILD_TYPE=release -Dpython_exec="~/HPM_PYTHON/bin/python3" -DCUSTOM_TARGET_TRIPLET=riscv-none-elf -DRV_ARCH="rv32imac_zicsr_zifencei" . -B=./build
cmake --build ./build
- name: Merge Bin
run: |
cd projects/HSLink-Pro
cp bootloader/build/output/HSLink-Pro-Bootloader.bin Merger.bin
dd if=src/build/output/HSLink-Pro.bin of=Merger.bin bs=1024 seek=127 conv=notrunc
- run: |
mkdir -p releases
cd releases
cp ../projects/HSLink-Pro/bootloader/build/output/HSLink-Pro-Bootloader.bin HSLink-Pro-Bootloader.bin
cp ../projects/HSLink-Pro/src/build/output/HSLink-Pro.uf2 HSLink-Pro.uf2
cp ../projects/HSLink-Pro/src/build/output/HSLink-Pro.bin HSLink-Pro.bin
cp ../projects/HSLink-Pro/Merger.bin Merger.bin
- name: Upload file
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: |
releases/HSLink-Pro-Bootloader.bin
releases/HSLink-Pro.uf2
releases/HSLink-Pro.bin
releases/Merger.bin
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Download release
uses: actions/download-artifact@v4
with:
name: build-artifact
path: releases
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: 'releases/*'
# tag: ${{ github.ref }}
allowUpdates: true