name: Build Software and create prerelease on tag on: push: tags: - "v[0-9]+.[0-9]+-PRERELEASE" # Trigger on PRERELEASE 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 Hardware Rev 0.3 # 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-Rev-0_3 -S ${{github.workspace}}/Software -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPICO_BOARD=RP2040-Decoder-board-Rev-0_3 - name: Build for Hardware Rev 0.3 # Build your program with the given configuration run: cmake --build ${{github.workspace}}/Software/build-Rev-0_3 --config ${{env.BUILD_TYPE}} - name: Configure and run CMake for Hardware Rev 1.0 # 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-Rev-1_0 -S ${{github.workspace}}/Software -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPICO_BOARD=RP2040-Decoder-board-Rev-1_0 - name: Build for Hardware Rev 1.0 # Build your program with the given configuration run: cmake --build ${{github.workspace}}/Software/build-Rev-1_0 --config ${{env.BUILD_TYPE}} - name: Upload build files as artifact Rev 0.3 uses: actions/upload-artifact@v4 with: name: build_files_Rev-0_3 path: ${{github.workspace}}/Software/build-Rev-0_3 - name: Upload build files as artifact Rev 1.0 uses: actions/upload-artifact@v4 with: name: build_files_Rev-1_0 path: ${{github.workspace}}/Software/build-Rev-1_0 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/Rev_1_0/RP2040-Decoder.kicad_pcb --autoTranslate --autoFill cd .. - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: fab_outputs_rev_1_0 path: ./KiCad/Rev_1_0/production prerelease: 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_rev_1_0 path: fab_outputs_rev_1_0 - name: Download build files artifact for Rev 0.3 uses: actions/download-artifact@v4 with: name: build_files_Rev-0_3 path: build_files_Rev-0_3 - name: Download build files artifact for Rev 1.0 uses: actions/download-artifact@v4 with: name: build_files_Rev-1_0 path: build_files_Rev-1_0 - name: ls run: ls - name: Zip fabrication outputs run: zip -r FABRICATION_OUTPUTS-REV-1_0.zip fab_outputs_rev_1_0 - name: Zip Rev 0.3 build files run: zip -r SW_BUILD-REV-0_3.zip build_files_Rev-0_3 - name: Zip Rev 1.0 build files run: zip -r SW_BUILD-REV-1_0.zip build_files_Rev-1_0 - name: Release uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: prerelease: true files: | SW_BUILD-REV-0_3.zip SW_BUILD-REV-1_0.zip FABRICATION_OUTPUTS-REV-1_0.zip