131 lines
4.7 KiB
YAML
131 lines
4.7 KiB
YAML
name: Build Software and create release on tag
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v[0-9]+.[0-9]+-RELEASE" # Trigger on RELEASE version tag push
|
|
|
|
|
|
env:
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
BUILD_TYPE: Debug
|
|
|
|
jobs:
|
|
build_sw:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: install build packages
|
|
run: sudo apt-get update && sudo apt-get install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi g++ libstdc++-arm-none-eabi-newlib build-essential
|
|
|
|
- name: Get SDK and add PICO_SDK_PATH
|
|
run: git clone https://github.com/raspberrypi/pico-sdk.git && echo "PICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk" >> $GITHUB_ENV
|
|
|
|
- name: Init submodules to get tinyUSB stack
|
|
run: ls && cd pico-sdk && git submodule update --init && cd ..
|
|
|
|
- name: Configure and run CMake for Legacy Hardware Revision
|
|
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
|
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
|
run: cmake -B ${{github.workspace}}/Software/build-Legacy -S ${{github.workspace}}/Software -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPICO_BOARD=RP2040-Decoder-board-Legacy
|
|
|
|
- name: Build for Legacy Hardware Revision
|
|
# Build your program with the given configuration
|
|
run: cmake --build ${{github.workspace}}/Software/build-Legacy --config ${{env.BUILD_TYPE}}
|
|
|
|
- name: Configure and run CMake for USB Hardware Revision
|
|
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
|
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
|
run: cmake -B ${{github.workspace}}/Software/build-USB -S ${{github.workspace}}/Software -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPICO_BOARD=RP2040-Decoder-board-USB
|
|
|
|
- name: Build for USB Hardware Revision
|
|
# Build your program with the given configuration
|
|
run: cmake --build ${{github.workspace}}/Software/build-USB --config ${{env.BUILD_TYPE}}
|
|
|
|
- name: Upload build files as artifact for Legacy Hardware Revision
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build_files_Legacy
|
|
path: ${{github.workspace}}/Software/build-Legacy
|
|
|
|
- name: Upload build files as artifact for USB Hardware Revision
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build_files_USB
|
|
path: ${{github.workspace}}/Software/build-USB
|
|
|
|
generate-fabrication-files:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install KiCad
|
|
run: |
|
|
sudo add-apt-repository --yes ppa:kicad/kicad-8.0-releases
|
|
sudo apt update
|
|
sudo apt install --install-recommends kicad
|
|
|
|
- name: Clone Fabrication Toolkit
|
|
run: |
|
|
git clone https://github.com/bennymeg/Fabrication-Toolkit.git
|
|
|
|
- name: Run fab toolkit CLI
|
|
run: |
|
|
cd Fabrication-Toolkit
|
|
python3 -m plugins.cli -p ../KiCad/USB/RP2040-Decoder.kicad_pcb --autoTranslate --autoFill
|
|
cd ..
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: fab_outputs_USB
|
|
path: ./KiCad/USB/production
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: [build_sw, generate-fabrication-files]
|
|
steps:
|
|
- name: install zip package
|
|
run: sudo apt-get install zip
|
|
|
|
- name: Download fabrication outputs artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: fab_outputs_USB
|
|
path: fab_outputs_USB
|
|
|
|
- name: Download build files artifact for Legacy Hardware Revision
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: build_files_Legacy
|
|
path: build_files_Legacy
|
|
|
|
- name: Download build files artifact for USB Hardware Revision
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: build_files_USB
|
|
path: build_files_USB
|
|
|
|
- name: ls
|
|
run: ls
|
|
|
|
- name: Zip fabrication outputs
|
|
run: zip -r FABRICATION_OUTPUTS-USB.zip fab_outputs_USB
|
|
|
|
- name: Zip SW_BUILD-Legacy files
|
|
run: zip -r SW_BUILD-Legacy.zip build_files_Legacy
|
|
|
|
- name: Zip SW_BUILD-USB files
|
|
run: zip -r SW_BUILD-USB.zip build_files_USB
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
SW_BUILD-Legacy.zip
|
|
SW_BUILD-USB.zip
|
|
FABRICATION_OUTPUTS-USB.zip |